Skip to content

Instantly share code, notes, and snippets.

View ByronMayne's full-sized avatar

Byron Mayne ByronMayne

View GitHub Profile
@krisbolton
krisbolton / fix-USB-showing-up-as-two-partitions.md
Last active September 24, 2024 17:31
How to fix a USB drive showing up as two drives (fragmented into multiple partitions) on Windows

How to fix a USB drive showing up as two drives (fragmented into multiple partitions) on Windows:

  1. Hold the Windows key and press X, select PowerShell (Admin), select Yes to the pop-up. You can also use Command Prompt.
  2. In the Powershell interface type diskpart to enter the disk partition tool.
  3. Type list disk to see all disks listed.
  4. Select the USB drive by typing select disk [NUMBER]. Be careful to select the correct drive.
  5. Type clean. An error will occur if you have the drive folder open, close the window and repeat the command if this happens.
  6. Type create partition primary.
  7. Type format fs=ntfs quick to format the drive (you can also choose to set fs=fat32).
  8. Type active.
@LotteMakesStuff
LotteMakesStuff / PlayerLoop.cs
Last active September 24, 2024 06:38
Player Loop Visualizer: Built to explore the new PlayerLoopSystem api in Unity 2018.1b2. This tool shows you all the PlayerLoop systems that unity uses to update a frame, and demos how to add your own and even remove systems from the player loop. For more info see the patreon post https://www.patreon.com/posts/unity-2018-1-16336053
// Put this in an editor folder
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
using UnityEngine.Experimental.LowLevel;
using UnityEngine.Profiling;
#if UNITY_EDITOR
using System.Reflection;
using UnityEngine;
using UnityEditor;
public class FontSwitcher : EditorWindow
{
[MenuItem("Font/Show Window")]
public static void ShowFontWindow()
{
@kimsama
kimsama / WebViewEditorWindow.cs
Created February 16, 2017 05:28
Open WebView window within Unity editor. It runs fine with Unity 5.5.x and no crash when closing Unity editor.
using UnityEngine;
using UnityEditor;
using System;
using System.Reflection;
/// <summary>
/// Open a webview within Unity editor. (similar as AssetStore window)
/// </summary>
public class WebViewEditorWindow : EditorWindow
{
@ByronMayne
ByronMayne / Point
Last active May 5, 2018 16:01
A int version of a Vector2 in Unity. Supports explicit conversion between the two types as well as a few helpful helper functions. The second script is a property drawer that supports panning of values and right clicking to reset the value to zero (taking from 3Ds Max).
using UnityEngine;
using System;
[Serializable]
public struct Point
{
[SerializeField]
public int x;
[SerializeField]
public int y;
@ByronMayne
ByronMayne / Injector.cs
Last active April 30, 2020 13:35
This code is used to inject a callback into Unity's internal build system. They should have this but if you really want to you can just make your own. This only needs Mono.Cecil #Magic
public class Injector
{
[MenuItem("Hacks/Inject Build Callback")]
public static void BuildCallback()
{
Assembly.BeginEditingAssembly(AssemblyTypes.UnityEditor, editAlreadyModifed:true);
{
TypeDefinition buildPiplelineType = Assembly.GetType<BuildPipeline>();
MethodDefinition buildInternalMethod = buildPiplelineType.GetMethod("BuildPlayerInternal");
@soheilhy
soheilhy / nginxproxy.md
Last active September 19, 2024 06:16
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@masa795
masa795 / UnityTextures.cs
Created June 17, 2013 14:12
Unityが持っているアイコンを表示する。 Unityのバージョンによってはパスが使えなくなるかもしれないので使用時は注意。
using System;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
//Unity 4.1.5
public class UnityTextures : EditorWindow
{