Skip to content

Instantly share code, notes, and snippets.

View dkleehammer's full-sized avatar

Daniel Kleehammer dkleehammer

  • Daniel-Bean
  • Dallas/Fort Worth
View GitHub Profile
@dkleehammer
dkleehammer / connection.js
Last active December 31, 2015 15:49
Asynchronous node connection object (prerequisites: Node v0.11.2+ using --harmony flag). To run, npm install, node --harmony main.js
"use strict";
exports = module.exports = function(app) {
var pool = app.get('pool'), Q = require('Q');
return {
execute: Q.async(function*(sql) {
var params = Array.prototype.slice.call(arguments, 1);
var deferred = Q.defer();
@dkleehammer
dkleehammer / app.js
Created July 31, 2013 22:08
Backbone/Marionette JS session handling example
define([
'marionette',
'router',
'controller',
'modules/auth',
'modules/vent',
'views/_layout'
], function(Marionette, Router, Controller, Auth, Vent, Layout){
var App = new Marionette.Application();