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
'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
#!/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
'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": "[email protected]", | |
"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
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
# from https://github.com/hapijs/contrib/issues/90#issuecomment-224889568 | |
tar -tf $(npm pack) && rm *.tgz |
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 Knex = require('./knex'); | |
const knex = Knex({ | |
dialect: 'postgres', | |
connection: { | |
adapter: 'postgresql', | |
database: 'test', | |
user: 'postgres' |
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 Hapi = require('hapi'); | |
// Keep track of the server's init state | |
var internals = { | |
initialized: false | |
}; | |
var server = new Hapi.Server(); | |
server.connection(); |
NewerOlder