Skip to content

Instantly share code, notes, and snippets.

View sscotth's full-sized avatar
🏠
𝄆 🍽 🛌 👨‍💻 𝄇

Scott Humphries sscotth

🏠
𝄆 🍽 🛌 👨‍💻 𝄇
View GitHub Profile
@sscotth
sscotth / keybase.md
Created October 28, 2014 03:16
keybase.md

Keybase proof

I hereby claim:

  • I am sscotth on github.
  • I am sscotth (https://keybase.io/sscotth) on keybase.
  • I have a public key whose fingerprint is 61AD 95F1 60FF C3FA A93A 0C86 E12E C4E0 BACA 0F74

To claim this, I am signing this object:

@sscotth
sscotth / security.json
Created December 12, 2014 21:20
Firebase Security Rules: Grants read/write access to the owner of this user account whose uid must exactly match the key ($uid)
{
"rules": {
"users": {
"$uid": {
".write": "auth !== null && auth.uid === $uid",
".read": "auth !== null && auth.uid === $uid"
}
}
}
}
@sscotth
sscotth / gist:c7ba00301eea3db21aa2
Created December 15, 2014 18:11
Display Timer
var beginTime = new Date()
function displayTimer(){
var secondsSinceBegin = moment.duration( Date.now() - beginTime ).asSeconds();
var formatAsTimer = moment().hour(0).minute(0).second(secondsSinceBegin).format('H:mm:ss');
console.log(formatAsTimer);
}
setInterval(displayTimer, 1000);
@sscotth
sscotth / s3.md
Last active August 29, 2015 14:11
S3 Hosting with S3-CLI

S3 Hosting notes

Install s3cmd

OSX: brew install s3cmd
Debian/Ubuntu: apt-get install s3cmd
Other: Download from http://s3tools.org/s3cmd

use s3cmd to create your .s3cfg config file

s3cmd --configure

@sscotth
sscotth / s3.md
Last active August 29, 2015 14:11
S3 File upload

Generate encoded policy and form signature

Run irb and execute the following commands with your bucket name and AWS secret key. You will need to save the encoded_policy string and the signature.

require 'base64'
require 'openssl'
require 'digest/sha1'

aws_secret_key = 'SKYBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXJoYL'
@sscotth
sscotth / game.js
Last active August 29, 2015 14:13
Game start
function Game(numberOfPlayers){
this.weapons = [];
this.weapons.push(new Weapon({name: 'Sword', damage: 0.2, ammo: Infinity}));
this.weapons.push(new Weapon({name: 'Shotgun', damage: 0.6, ammo: 1}));
this.weapons.push(new Weapon({name: 'Fist', damage: 0.05, ammo: Infinity}));
this.players = [];
for (var i=0; i < numberOfPlayers; i++){
var player = new Player;
@sscotth
sscotth / app.js
Created April 24, 2015 20:53
Pirates vs Ninjas
function Pirate() {
this.says = 'ARRRRRRRRRRRRRR!';
this.toString = function() { return 'Pirate'; };
}
function Ninja() {
this.says = '';
this.toString = function() { return 'Ninja'; };
}

Android Deployment Instructions for Mac OS X

Deployment on Android device

  • Run: "sudo npm install -g cordova"
  • Run: "sudo npm install -g ionic"
  • Run: "brew install android-sdk"
  • Run: “android” then install the following packages
    • Tools: Andoird SDK Tools, Android SDK Platform-tools, Android SDK Build-tools
    • Android 4.4.2 (API 19)
  • Extras: Android Support Library
TTTTBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBTTTT
TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
RRRRRRRRRRRTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
RWWWWRWWWWRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
RWWRRRWWRRRWWWWRWWWWRWWWWWWRWWRWRRRRWWRWWWWR
RWWWWRWWWWRWWRWRWWRWRRWWRWRRWWWWRRRRWWRWWRWR
RRRRWRRRRWRWWRRRWWRWRRWWRWRRWWRWRWWRWWRWWRWR
RWWWWRWWWWRWWWWRWWWWRRWWRWRRWWRWRWWRWWRWWWWR
RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
@sscotth
sscotth / gist:55e7265c73b6d9bcbdbe
Last active November 23, 2015 21:53
Reset commits before push
git filter-branch -commit-filter 'if [ "$GIT_AUTHOR_EMAIL" = "scott@Scotts-MacBook-Pro.local" ]; then export GIT_AUTHOR_NAME="Scott Humphries"; export GIT_AUTHOR_EMAIL=git@sscotth.io; export GIT_COMMITTER_NAME="Scott Humphries"; export GIT_COMMITTER_EMAIL=git@sscotth.io; fi; git commit-tree "$@"'