Skip to content

Instantly share code, notes, and snippets.


John Bubriski jbubriski

View GitHub Profile
jbubriski / LightFlickerEffect.cs
Created September 10, 2021 19:44 — forked from sinbad/LightFlickerEffect.cs
Unity simple & fast light flicker script
View LightFlickerEffect.cs
using UnityEngine;
using System.Collections.Generic;
// Written by Steve Streeting 2017
// License: CC0 Public Domain
/// <summary>
/// Component which will flicker a linked light while active by changing its
/// intensity between the min and max values given. The flickering can be
/// sharp or smoothed depending on the value of the smoothing parameter.
jbubriski / CollectionExtensions.cs
Created June 2, 2021 18:05 — forked from codeimpossible/CollectionExtensions.cs
Sound Effect Scriptable Object
View CollectionExtensions.cs
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
namespace NoirLib {
public static class CollectionExtensions {
private static readonly System.Random _rand = new System.Random();
public static T Random<T>(this T[] items) {
jbubriski / GameManager.cs
Created November 23, 2017 00:03 — forked from codeimpossible/GameManager.cs
Cross Platform GamePad Input for Unity
View GameManager.cs
using System;
using UnityEngine;
public class GameManager : MonoBehaviour {
public IInputSystem Input;
public static GameManager Instance;
void Awake() {
jbubriski / BehaviourButtonsEditor
Created November 17, 2016 15:45
Add editor buttons to your MonoBehaviours methods
View BehaviourButtonsEditor
using UnityEditor;
using UnityEngine;
namespace BitStrap
/// <summary>
/// Custom editor for all MonoBehaviour scripts in order to draw buttons for all button attributes (<see cref="ButtonAttribute"/>).
/// </summary>
[CustomEditor( typeof( MonoBehaviour ), true, isFallback = true )]
jbubriski / StopPlayingOnRecompile.cs
Created November 8, 2016 16:23 — forked from mrcarriere/StopPlayingOnRecompile.cs
Force Unity to stop playing if you have edited a source file. Helps avoid some editor crashes and false positives / error spam. To use, drop this script in an "Editor" folder in your project.
View StopPlayingOnRecompile.cs
using UnityEditor;
public class StopPlayingOnRecompile
static StopPlayingOnRecompile()
EditorApplication.update += () =>
if (EditorApplication.isCompiling && EditorApplication.isPlaying)
jbubriski / BuildSceneProcessor.cs
Created November 8, 2016 16:23 — forked from mrcarriere/BuildSceneProcessor.cs
Automatically add a scene to your Build Settings when you create or save the scene. Scenes that are ignored will not re-prompt for the current session.
View BuildSceneProcessor.cs
using UnityEngine;
using UnityEditor;
using System.Collections;
using System.Collections.Generic;
// docs:
public class BuildSceneProcessor : UnityEditor.AssetModificationProcessor
private const string DIALOG_TITLE = "Add to Build Settings?";
private const string DIALOG_MSG = "Add to build settings for inclusion in future builds?";
jbubriski / menus.js
Created January 14, 2016 16:52 — forked from phoboslab/menus.js
Z-Type Menu
View menus.js
MenuItem = ig.Class.extend({
getText: function(){ return 'none' },
jbubriski / example.js
Last active August 29, 2015 14:18 — forked from zachstronaut/example.js
impact js gamepad
View example.js
// bind keyboard and gamepad buttons
ig.input.bind( ig.KEY.X, 'shoot1');
ig.input.bind( ig.GAMEPAD1.FACE_1, 'shoot1');
ig.input.bind( ig.GAMEPAD2.FACE_1, 'shoot2');
ig.input.bind( ig.GAMEPAD3.FACE_1, 'shoot3');
ig.input.bind( ig.GAMEPAD4.FACE_1, 'shoot4');
#!/usr/bin/env python
# saved to ~/bin/ and from
#!/usr/bin/env python
# coding=UTF-8
import math, subprocess
p = subprocess.Popen(["ioreg", "-rc", "AppleSmartBattery"], stdout=subprocess.PIPE)
output = p.communicate()[0]
View IIS Rewrite Cheat Sheet
<!-- Have a bunch of redirects? Put them in a separate file -->
<rules configSource="Rewrites.config" />
<!-- Simple rewrite -->
<rule name="Simple redirect" stopProcessing="true">
<match url="^path/sub path/page\.aspx$" />
<action type="Rewrite" url="/newpath.aspx" />