This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function () { | |
| function getCommitHash() { | |
| var commitLink = document.querySelectorAll('.commit-title a.message')[0]; | |
| return commitLink.pathname.split('/').slice(-1)[0]; | |
| } | |
| function replaceBranchWithCommit(branchURL, commitHash) { | |
| return branchURL.replace(/\/blob\/[^\/]+\//, '/blob/' + commitHash + '/'); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [Flags] | |
| public enum UnityLifetime | |
| { | |
| Nothing = 0x00, | |
| Awoke = 0x01, | |
| Started = 0x02, | |
| Destroyed = 0x04, | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # Turn a video into a gif | |
| # Written with help from: | |
| # | |
| # http://chrismessina.me/b/13913393/mov-to-gif | |
| # http://www.lcdf.org/gifsicle/man.html | |
| # | |
| # It's not very robust. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // whoops | |
| csharp> Action<Action> makeInvoker = (funarg) => new Action(() => funarg()); | |
| Mono.CSharp.InternalErrorException: (1,31): <InteractiveExpressionClass>.<Host>m__0(System.Action) ---> Mono.CSharp.InternalErrorException: (1,1): ---> System.NotImplementedException: The requested feature is not implemented. | |
| at Mono.CSharp.AnonymousMethodBody.EmitStatement (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 | |
| at Mono.CSharp.ContextualReturn.DoEmit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 | |
| at Mono.CSharp.Statement.Emit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 | |
| at Mono.CSharp.Block.DoEmit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 | |
| at Mono.CSharp.ExplicitBlock.Emit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 | |
| at Mono.CSharp.ParametersBlock.Emit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 | |
| at Mono.CSharp.ToplevelBlock.Emit (Mono.CSharp.EmitContext ec) [0x00000] in <filename unknown>:0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // YTEMBEDDED | |
| // The youtube page can't go full-window, and full-screen mode in browser is annoying. | |
| // Solution: make it easy to go to a youtube video's embed URL. | |
| // | |
| // Tries to grab the current video time. If that fails, it looks for a ?t query parameter. | |
| // Otherwise you just get to watch the video from the beginning. | |
| (function () { | |
| function extractQueryParams(search) { | |
| return (search.slice(1). | |
| split('&'). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| zsh 1 [1] % ./build.sh | |
| Downloading kvm as script to '/Users/michaelbartnett/.k/kvm' | |
| Downloading kvm from 'https://raw.githubusercontent.com/aspnet/Home/master/kvm.sh' | |
| => Source string already in /Users/michaelbartnett/.bash_profile | |
| => Source string already in /Users/michaelbartnett/.zshrc | |
| Type 'source /Users/michaelbartnett/.k/kvm/kvm.sh' to start using kvm | |
| Downloading kre-mono.1.0.0-beta3 from https://www.nuget.org/api/v2 | |
| Installing to /Users/michaelbartnett/.k/runtimes/kre-mono.1.0.0-beta3 | |
| Adding /Users/michaelbartnett/.k/runtimes/kre-mono.1.0.0-beta3/bin to process PATH |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| #if UNITY_EDITOR | |
| using UnityEditor; | |
| #endif | |
| public class CharacterListScriptThing : MonoBehaviour | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // This function causes the error pasted below it: | |
| public class GameDataDefinitionWebProvider | |
| { | |
| // skipping several things... | |
| public IFuture<IEnumerable<GameDataDefinition>> FetchAll() | |
| { | |
| var result = new SimpleFuture<IEnumerable<GameDataDefinition>>(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public void PrewarmAnimations() | |
| { | |
| // Animation.RebuildInternalState causes massive frame spikes | |
| // http://forum.unity3d.com/threads/animation-rebuildinternalstate-ms-spikes.123480/#post-1560774 | |
| // This iterates through the animations to read them into memory in order to try avoiding this. | |
| int animationCount = 0; | |
| foreach (var anim in animationRootObject.animation) { | |
| animationCount++; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from assembly in AppDomain.CurrentDomain.GetAssemblies() | |
| #if TEST | |
| let typeList = | |
| (new Func<Type[]>(() => { | |
| Type[] result = null; | |
| try { | |
| result = assembly.GetTypes(); | |
| } catch (ReflectionTypeLoadException) { | |
| if (assembly.FullName.StartsWith("MonoDevelop.NUnit")) { | |
| // the MonoDevelop.NUnit assembly is screwed up |