Skip to content

Instantly share code, notes, and snippets.

{
"name": "hapi-request",
"main": "server.js",
"scripts": {
"test": "lab -v test.js"
},
"devDependencies": {
"code": "^1.3.0",
"lab": "^5.2.1",
"sinon": "^1.12.2"

2015-01-29 Unofficial Relay FAQ

Compilation of questions and answers about Relay from React.js Conf.

Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.

What is Relay?

Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).

  1. generate an empty migration
  2. move the migration from old_app to new_app
  3. edit the migration file to change all instances of old_app to new_app
  4. add a forward migration to rename the table from something to something_else
  5. add a backward migration to do the opposite
  6. move models.py from old_app to new_app
  7. apply the migration
@willrstern
willrstern / gist:a46567b4f489c4c30f29
Last active February 13, 2018 17:29
JAVASCRIPT AND ASYNC OPERATIONS

##The Good, The Bad, & The Ugly Ways of handling Async Operations With Javascript## #####Callbacks < Promises < Generators#####


###An Example: 5 in-sequence Async Operations### (also see parallel-sequence example: https://gist.github.com/willrstern/af3a3308fc5864cf48f8)
###The Ugly Way: Callbacks### After each function takes place, handle any errors & do the next thing - It's easy to walk through the code and understand what's going on...but it's ugly as sin
var BVT = function(width, depth, init, elems) {
this._width = width;
this._depth = depth;
this._leaf = depth === 1;
this._shift = (this._depth - 1) * Math.round(Math.log(width) / Math.log(2));
this._himask = this._width - 1;
this._lomask = Math.pow(2, this._shift) - 1;
this._elems = elems;
@rolph-recto
rolph-recto / contractions.py
Last active January 14, 2016 18:06
Featureset builder for tweets Used for classification and other machine learning tasks
# contractions.py
# list from: http://en.wikipedia.org/wiki/Wikipedia:List_of_English_contractions
contractions = [
("aren't", "are not"),
("can't", "cannot"),
("can't've", "cannot have"),
("'cause", "because"),
("could've", "could have"),
("couldn't", "could not"),
("couldn't've", "could not have"),