Skip to content

Instantly share code, notes, and snippets.

View fadookie's full-sized avatar
🕹️
😹

Eliot Lash fadookie

🕹️
😹
View GitHub Profile
@fadookie
fadookie / gist:2722095
Created May 17, 2012 22:41
IRC minus one
[15:40] <mvl> i'm still curious, do you see a minus one here 1
[15:41] <eliot> no I don't
[15:41] <eliot> looks like a 1
[15:41] <eliot> do you see a minus one here? -1
[15:41] <mvl> hmm somethings stripping out the dash then
[15:41] <eliot> what irc client are you using?
[15:41] <mvl> cause i typed -1
[15:41] <mvl> minus one
[15:41] <mvl> "-1"
[15:41] <eliot> now I see it
@fadookie
fadookie / gist:4392708
Created December 27, 2012 22:32
Retrieve random object from NSSet
//Implemented based on the pseudo-code in http://stackoverflow.com/a/9981965/350761
int randomIndex = arc4random() % [set count];
__block int currentIndex = 0;
__block id selectedObj = nil;
[set enumerateObjectsUsingBlock:^(id obj, BOOL *stop) {
if (randomIndex == currentIndex) { selectedObj = obj; *stop = YES; }
else currentIndex++;
}];
return selectedObj;
@fadookie
fadookie / strip.conf
Last active June 4, 2016 00:28 — forked from dextorer/strip.conf
google-play-services-strip-script
actions=false
ads=true
analytics=false
appindexing=false
appstate=true
auth=true
cast=false
common=true
drive=true
dynamic=false
@fadookie
fadookie / bwAdditive.shader
Created January 19, 2015 15:21
Hacked version of Unity's Additive Particle shader w/ a parameter to enable B&W rendering with a weird worm tail bug. Used in http://gamejolt.com/games/other/raney2/45350/
Shader "eliotlash/Particles/Additive B&W" {
Properties {
_TintColor ("Tint Color", Color) = (0.5,0.5,0.5,0.5)
_MainTex ("Particle Texture", 2D) = "white" {}
_InvFade ("Soft Particles Factor", Range(0.01,3.0)) = 1.0
_BWEffectOn ("B&W Effect On", Range(0, 1)) = 0
}
Category {
Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" }
@fadookie
fadookie / gist:7ae5cbec94245609165efee08da21c17
Created September 30, 2016 19:49
git quote-string test output
$ git quote-string
foo "bar"
"!foo \"bar\"
#"
@fadookie
fadookie / .bash_profile
Last active November 16, 2016 21:33
.bash_profile for android/unity stuff
export JAVA_HOME=`/usr/libexec/java_home`
export ANDROID_HOME="$HOME/Dev/android/android-sdk-macosx" #Set this path to your android sdk
export PATH="$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:${ANDROID_HOME}/build-tools/$(ls ${ANDROID_HOME}/build-tools | sort -r | head -n 1)"
alias unilogcat='adb logcat|egrep "Unity|Kiwi|GamesUnitySDK|GamesNativeSDK|Supersonic|KONG|E API"'
@fadookie
fadookie / bash_list_library.sh
Last active August 2, 2017 21:55
Example of bash array to pipe-delimited string de/serialization, for discussion at https://discuss.bitrise.io/t/output-from-multiple-instances-of-the-same-step/538
# WARNING! The following is not as safe as I originally thought and I'm not sure yet the right way to do this.
# See https://unix.stackexchange.com/questions/383541/how-to-save-restore-all-shell-options-including-errexit
enable_safety() {
BITRISE_CLI_PREVIOUS_SHELL_OPTIONS=$(set +o)
set -o nounset
set -o errexit
set -o pipefail
}
@fadookie
fadookie / 92-C# Class-NewClass.cs.txt
Last active January 10, 2018 03:35
Some handy Create file templates for Unity 5.2
namespace ExampleNamespace
{
public class #SCRIPTNAME#
{
}
}
@fadookie
fadookie / Services.cs
Last active January 19, 2018 21:57
Service manager for unity (for accessing single instances of objects globally) and tests
using System;
using System.Collections.Generic;
/// <summary>
/// Simple service manager. Allows global access to a single instance of any class.
/// Copyright (c) 2014-2017 Eliot Lash
/// </summary>
public class Services
{
//Statics
@fadookie
fadookie / realmMock.js
Created September 18, 2018 00:09 — forked from hyb175/realmMock.js
Realm Mock backed by AsyncStorage to try to enable on-device debugging
// https://github.com/realm/realm-js/issues/370#issuecomment-270849466
import { AsyncStorage } from "react-native"
const STORAGE_KEY = 'MockRealm';
export default class Realm {
constructor(params) {
this.schema = {};
this.callbackList = [];