Skip to content

Instantly share code, notes, and snippets.

View tayl0r's full-sized avatar

Taylor Steil tayl0r

View GitHub Profile
@tayl0r
tayl0r / gist:aef79937a11e10bf663e
Created December 11, 2014 19:09
get launch options
+ (void)load
{
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidReceiveMemoryWarning:) name:UIApplicationDidReceiveMemoryWarningNotification object:nil];
// this one contains userInfo about our notification
//[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(FoxCubIosOnLoad:) name:UIApplicationDidFinishLaunchingNotification object:nil];
// these two do not contain any useful userInfo about notifications
//[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(FoxCubIosOnLoad:) name:UIApplicationDidBecomeActiveNotification object:nil];
//[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(FoxCubIosOnLoad:) name:UIApplicationWillEnterForegroundNotification object:nil];
@tayl0r
tayl0r / gist:959b1aebb871080fa6ae
Created December 8, 2014 15:02
FCSponsorPay.cs
#if !UNITY_EDITOR || FCLOG
using Debug = FC.Debug;
#else
using Debug = UnityEngine.Debug;
#endif
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
@tayl0r
tayl0r / gist:6e92540e6f28655ac639
Last active August 29, 2015 14:06
jsonfx reader for emoji
case 'u':
{
// Unicode escape sequence
// e.g. Copyright: "\u00A9"
// unicode ordinal
int utf16;
if (this.index+4 < this.SourceLength &&
Int32.TryParse(
this.Source.Substring(this.index+1, 4),
@tayl0r
tayl0r / gist:48d3ed2f916a91d1cc2c
Created September 11, 2014 22:02
jsonfx reader for emoji
case 'u':
{
// Unicode escape sequence
// e.g. Copyright: "\u00A9"
// unicode ordinal
int utf16;
if (this.index+4 < this.SourceLength &&
Int32.TryParse(
this.Source.Substring(this.index+1, 4),
@tayl0r
tayl0r / startUnity.bat
Created July 31, 2014 15:32
command line Unity startup of specific project
perl startUnity.pl
@tayl0r
tayl0r / bugsense
Last active August 29, 2015 14:03
bugsense breadcrumbs newlines
using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;
// for some reason its not letting me change the language to c# =(
// report is a HashTable with lots of bugsense data in it, including the breadcrumbs
string jsonReport = string.Format("data={0}", JsonFx.Json.JsonWriter.Serialize(report));
@tayl0r
tayl0r / redshiftexplainplan
Created June 26, 2014 20:22
redshift wtf explain plan
10 second query:
XN Merge (cost=1000000000000.07..1000000000000.07 rows=1 width=76)
-> XN Network (cost=1000000000000.07..1000000000000.07 rows=1 width=76)
-> XN Sort (cost=1000000000000.07..1000000000000.07 rows=1 width=76)
-> XN HashAggregate (cost=0.05..0.06 rows=1 width=76)
-> XN Subquery Scan volt_dt_0 (cost=0.04..0.05 rows=1 width=76)
-> XN HashAggregate (cost=0.04..0.04 rows=1 width=76)
-> XN Subquery Scan derived_table1 (cost=0.02..0.03 rows=1 width=76)
-> XN HashAggregate (cost=0.02..0.02 rows=1 width=44)
@tayl0r
tayl0r / start
Created April 29, 2014 11:55
teamcity startup logs from /Applications/TeamCity/buildAgent/logs/* and /Applications/TeamCity/logs/*
==> /Applications/TeamCity/buildAgent/logs/output.log <==
Starting TeamCity Build Agent Launcher...
Agent home directory is /Applications/TeamCity/buildAgent
Lock file: /Applications/TeamCity/buildAgent/logs/buildAgent.properties.lock
==> /Applications/TeamCity/buildAgent/logs/launcher.log <==
[2014-04-29 13:51:24,003] DEBUG - dServer.agent.lock.LockManager - Lock file: /Applications/TeamCity/buildAgent/logs/buildAgent.properties.lock
==> /Applications/TeamCity/buildAgent/logs/output.log <==
Using no lock
#!/usr/bin/perl
# Searches for other PostprocessBuildPlayer scripts and executes them. Make sure the other script
# have a name suffix with an underscore "_" like "PostprocessBuildPlayer_AnotherBuild" or whatever.
#
# Based on script by Rob Terrell, rob@stinkbot.com
#
use File::Glob ':glob';
@tayl0r
tayl0r / 1_CommandLineApp.cs
Last active August 29, 2015 14:00
c# command line app - threading & async
static void Main(string[] args) {
// this news a new instance of TournamentService/BaseService,
// which runs StartTickLoop, which creates the new threads
BaseService.OnStart(true);
Console.CancelKeyPress += delegate(object sender, ConsoleCancelEventArgs e) {
Console.WriteLine("captured ctrl-c, setting close flag");
e.Cancel = true;
CommandLineApp.close = true;
};