model
is a redux store.- actions are thunks.
- nap() via
model.subscribe()
. - present() is
model.dispatch()
. - acceptor logic is redux middleware.
- state/learner is implemented with
ReactRedux.connect()
and selectors (i.e. reselect).
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
// Mock scheme for testing | |
server.auth.scheme('mock', function(server, options) { | |
return { | |
authenticate: function(request, reply) { | |
reply({credentials: options}); | |
} | |
}; | |
}); |
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
#!/usr/bin/env bash | |
branch=$(git symbolic-ref --short HEAD) | |
version=$1 | |
if ! [[ $branch =~ ^flavor- ]]; then | |
echo "Not on a flavor branch" >&2 | |
exit 1 | |
fi |
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
var util = require('util'); | |
var _ = require('lodash'); | |
var sinon = require('sinon'); | |
/** | |
* Replaces a query method on the given model object with a stub. The query | |
* will still operate on a callback, and allow full access to waterline's | |
* deferred object. However, the query will not cause any I/O and instead | |
* will immediately resolve to the given result. | |
* |
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
'use strict'; | |
const tree = require('require-dir')(null, { | |
recurse: true // Consider also adding filter() to ignore e.g. helper directories | |
}); | |
const flatten = (routes, obj) => { | |
if (Array.isArray(obj) || (obj.path && obj.method)) { | |
return routes.concat(obj); |
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
include /etc/nginx/conf.d/real-scheme.block; | |
upstream <app> { | |
server 127.0.0.1:<port>; | |
keepalive 16; | |
} | |
server { | |
listen 80; | |
server_name <server>; |
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
'use strict'; | |
const Hapi = require('hapi'); | |
const Underdog = require('underdog'); | |
const Vision = require('vision'); | |
const Handlebars = require('handlebars'); | |
const Spdy = require('spdy'); | |
const Http2 = require('http2'); | |
const agent = new Http2.Agent({ rejectUnauthorized: false }); |
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
{"web-app": { | |
"servlet": [ | |
{ | |
"servlet-name": "cofaxCDS", | |
"servlet-class": "org.cofax.cds.CDSServlet", | |
"init-param": { | |
"configGlossary:installationAt": "Philadelphia, PA", | |
"configGlossary:adminEmail": "ksm@pobox.com", | |
"configGlossary:poweredBy": "Cofax", | |
"configGlossary:poweredByIcon": "/images/cofax.gif", |
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
document.write('i was pushed!'); |
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
# from https://github.com/hapijs/contrib/issues/90#issuecomment-224889568 | |
tar -tf $(npm pack) && rm *.tgz |
NewerOlder