Skip to content

Instantly share code, notes, and snippets.

View brianchirls's full-sized avatar

Brian Chirls brianchirls

View GitHub Profile
@brianchirls
brianchirls / pseudo-random.js
Created January 26, 2018 19:52
Repeatable pseudo-random number generator based on predictable input values
import hash from 'string-hash';
function stringHash(s) {
if (s.length === 1) {
return s.charCodeAt(0);
}
return hash(s);
}
@brianchirls
brianchirls / firebase-timing-test.js
Last active December 27, 2017 16:56
Firebase realtime database trigger timing test
'use strict'; // until node.js supports modules
console.time('require dependencies');
const functions = require('firebase-functions');
console.timeEnd('require dependencies');
function checkDelay(event) {
const time = Date.now();
const eventTime = Date.parse(event.timestamp);
const snapshot = event.data;
@brianchirls
brianchirls / boost-hbg-web-vr-projects.md
Last active November 17, 2015 15:53
Boost HBG Web VR Projects
@brianchirls
brianchirls / gist:60b4fc05e225ace40f38
Created March 26, 2015 20:33
tns debug android --debug-brk --log trace
Starting watch on killswitch /var/folders/3y/vhmdsjk90w17389dp4_zznbw0000gn/T/Home/KillSwitches/cli
spawn: adb version
Looking for project in '/Users/Home/code/tns/the-and'
Project directory is '/Users/Home/code/tns/the-and'.
Project successfully prepared
Project successfully prepared
spawn: ant debug -f /Users/Home/code/tns/the-and/platforms/android/build.xml
Buildfile: /Users/Home/code/tns/the-and/platforms/android/build.xml
-set-mode-check:
@brianchirls
brianchirls / gist:2b497a0561763030e774
Created March 23, 2015 14:47
tns run android --emulator --log trace
Starting watch on killswitch /var/folders/3y/vhmdsjk90w17389dp4_zznbw0000gn/T/Home/KillSwitches/cli
Looking for project in '/Users/Home/code/tns-hello-world'
Project directory is '/Users/Home/code/tns-hello-world'.
spawn: adb version
Project successfully prepared
spawn: emulator -help
Project successfully prepared
spawn: ant debug -f /Users/Home/code/tns-hello-world/platforms/android/build.xml
Buildfile: /Users/Home/code/tns-hello-world/platforms/android/build.xml
@brianchirls
brianchirls / gist:86fd81abd2e557dfaabc
Created December 3, 2014 15:41
screen lock orientation
if (screen.lockOrientation) {
screen.lockOrientation('portrait-primary');
} else if (screen.mozLockOrientation) {
screen.mozLockOrientation('portrait-primary');
} else if (screen.orientation && screen.orientation.lock) {
screen.orientation.lock('portrait-primary');
}