Skip to content

Instantly share code, notes, and snippets.

View donovan-graham's full-sized avatar

Donovan Graham donovan-graham

View GitHub Profile
# jump up, jump up and get down ~ https://www.youtube.com/watch?v=oZ5QLXTUTRA
alias ..='cd ..'
alias ...='cd ../../../'
alias ....='cd ../../../../'
# `docker` aliases
alias drn='docker run --rm -it -v $(pwd):/data -w /data -P node:7.5-slim'
alias dex='docker exec -it'
alias dps='docker ps'
/*
This example shows how you can use your data structure as a basis for
your Firebase security rules to implement role-based security. We store
each user by their Twitter uid, and use the following simplistic approach
for user roles:
0 - GUEST
10 - USER
20 - MODERATOR
/**
* Fancy ID generator that creates 20-character string identifiers with the following properties:
*
* 1. They're based on timestamp so that they sort *after* any existing ids.
* 2. They contain 72-bits of random data after the timestamp so that IDs won't collide with other clients' IDs.
* 3. They sort *lexicographically* (so the timestamp is converted to characters that will sort properly).
* 4. They're monotonically increasing. Even if you generate more than one in the same timestamp, the
* latter ones will sort after the former ones. We do this by using the previous random bits
* but "incrementing" them by 1 (only in the case of a timestamp collision).
*/

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@donovan-graham
donovan-graham / Hammer-JS-event-order.markdown
Last active August 29, 2015 14:13
Hammer JS event order

Hammer JS event order

A single panLeft/panRight event is being fired before panStart. This seems like buggy behaviour

A Pen by Donovan Graham on CodePen.

License.