Skip to content

Instantly share code, notes, and snippets.

View tayl0r's full-sized avatar

Taylor Steil tayl0r

View GitHub Profile
public GUIText[] m_numbers = new GUIText[100];
void Start() {
if (m_timer) {
for (int i = 0; i < 11; ++i) {
GUIText number = Instantiate(m_timer) as GUIText;
number.text = i.ToString();
number.enabled = false;
Debug.Log(i);
using System.IO;
using UnityEngine;
using UnityEditor;
using UnityEditor.Callbacks;
public static class PostBuildTrigger
{
// Frameworks Ids - These ids have been generated by creating a project using Xcode then
// extracting the values from the generated project.pbxproj. The format of this
// file is not documented by Apple so the correct algorithm for generating these
I/Unity ( 1559): purchase failed: User canceled. (response: -1005:User cancelled)
I/Unity ( 1559):
I/Unity ( 1559): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 53)
I/Unity ( 1559):
I/Unity ( 1559): INVENTORY: credits_5000_199
I/Unity ( 1559):
I/Unity ( 1559): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 53)
I/Unity ( 1559):
I/Prime31 ( 1559): Attempting to consume an item that has not been purchased. Aborting to avoid exception. sku: credits_5000_199
I/Unity ( 1559): INVENTORY: credits_25000_499
@tayl0r
tayl0r / ProgressBar.shader
Created March 6, 2014 02:26
unity3d shader based progress bar
Shader "Custom/ProgressBar"
{
Properties
{
_MaskTex ("Mask Tex", 2D) = "white" {}
_BarTex ("Bar Tex", 2D) = "white" {}
_Progress ("Progress", range(0, 1)) = .5
_C1 ("C1", Color) = (1, 1, 1, 0)
//_C2 ("C2", Color) = (0, 0, 0, 1)
@tayl0r
tayl0r / link.xml
Created March 13, 2014 21:35
unity link.xml
@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;
};
#!/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, [email protected]
#
use File::Glob ':glob';
@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
@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 / 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));