Skip to content

Instantly share code, notes, and snippets.

@devinivy
devinivy / index.js
Last active May 5, 2016 12:40
Knex locked connections
'use strict';
const Knex = require('./knex');
const knex = Knex({
dialect: 'postgres',
connection: {
adapter: 'postgresql',
database: 'test',
user: 'postgres'
@devinivy
devinivy / server.js
Created January 20, 2016 03:34
Testing an initialized hapi server
var Hapi = require('hapi');
// Keep track of the server's init state
var internals = {
initialized: false
};
var server = new Hapi.Server();
server.connection();
@devinivy
devinivy / polymer-w-reflux.md
Last active January 27, 2016 19:59
Polymer with Reflux

Polymer with Reflux

Implementation

Ties together Polymer and Reflux

Is a demo of using Polymer with Reflux via funk

The Pieces

These are thoughts pre-funk!

@devinivy
devinivy / supertouch.sh
Created January 15, 2016 21:13
Create all necessary dirs while touching a file
# from http://unix.stackexchange.com/a/168582
supertouch() {
for p in "$@"; do
_dir="$(dirname -- "$p")"
[ -d "$_dir" ] || mkdir -p -- "$_dir"
touch -- "$p"
done
}
module.exports = function (graph, root) {
var traversal = graph.traverse();
var edges = [];
var stack = [root];
var current = null;
while (stack.length) {
traversal.hop(stack.pop());