# Header 1
## Header 2
### Header 3
This is a paragraph.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* @flow */ | |
import _ from "lodash"; | |
type UserId = string; | |
type UserRole = | |
'admin' | | |
'guest' | | |
'member'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// - rendering library (like React) should be able to "pick up" where server | |
// left off (i.e. hook up to the existing HTML) | |
// server.js | |
var server = express(); | |
server.use(function(req, res) { | |
var appHtml = React.renderToString(<App />); | |
var html = injectIntoHtml({app: appHtml}); | |
res.send(html); |
Rough draft exploring the possibility of building a web app without a framework, picking and choosing from small & focused pieces, a la Unix.
- Package manager: npm (and Bower?)
- Build tool: Grunt, Browserify
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Change variable names to another naming convention | |
// | |
// Thanks to Oliver Caldwell for the inspiration | |
// http://oli.me.uk/2013/09/25/grabbing-elements-from-the-dom/ | |
// 'hello_world' -> 'helloWorld' | |
function snakeToCamelCase(name) { | |
return name.toLowerCase().replace(/_(\w)/ig, function (match, hump) { | |
return hump.toUpperCase(); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sexy Bash Prompt, inspired by "Extravagant Zsh Prompt" | |
# Shamelessly copied from https://github.com/gf3/dotfiles | |
# Screenshot: http://cloud.gf3.ca/M5rG | |
# A big thanks to \amethyst on Freenode | |
if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then export TERM=gnome-256color | |
elif [[ $TERM != dumb ]] && infocmp xterm-256color >/dev/null 2>&1; then export TERM=xterm-256color | |
fi | |
if tput setaf 1 &> /dev/null; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Usage: | |
// cat customers_raw.json | node process_customers > customers.json | |
// https://github.com/dominictarr/JSONStream | |
var JSONStream = require('JSONStream'); | |
// https://github.com/rvagg/through2 | |
var through2 = require('through2'); | |
process.stdin | |
.pipe(JSONStream.parse('*')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Ink file picker encoded security policy and its signature with Node.js | |
https://www.inkfilepicker.com/ | |
https://developers.inkfilepicker.com/docs/security/ | |
Usage: | |
ink.encodePolicy({ | |
handle: 'KW9EJhYtS6y48Whm2S6D', | |
expiry: 1508141504 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Exploring using "expose React component tree as data" @swannodette | |
// (https://www.youtube.com/watch?v=5hGHdETNteE#t=1559) | |
// for routing and fetching data ("react-router-mega-demo" @ryanflorence) | |
// (https://github.com/rackt/react-router-mega-demo/blob/master/app/utils/fetchData.js) | |
var appState = { | |
route: '/contacts', | |
contacts: [], | |
messages: [] | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ mix deps | |
* fs 0.9.1 (Hex package) (rebar) | |
locked at 0.9.2 (fs) | |
ok | |
* gettext 0.9.0 (Hex package) (mix) | |
locked at 0.9.0 (gettext) | |
ok | |
* ranch 1.2.1 (Hex package) (rebar) | |
locked at 1.2.1 (ranch) | |
ok |