This file contains hidden or 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
//Of course you may want to do more configuration than this. | |
var app = express(); | |
var env = nunjucks.configure('/views', { | |
autoescape: true, | |
express: app, | |
tags: { | |
variableStart: '<$', | |
variableEnd: '$>' | |
} |
This file contains hidden or 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
//Here is a simple example. Pretend we are using express. | |
var app = express(); | |
var config; | |
var db = new ConfigServerThing(); | |
//This part is useless because the main loop exits before we call app.listen() | |
db.find(function(err, config) { | |
if(err) throw err; |
This file contains hidden or 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
CLOUDINARY_URL=cloudinary://null | |
MANDRILL_API_KEY=null | |
COOKIE_SECRET="Cat Keyboard" | |
MONGO_URI="mongodb://localhost/myexample" | |
DOMAIN="myexample" | |
BRAND="Vendorlizer" |
This file contains hidden or 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
for i in $(ls | cut -d "." --complement -f2- ); do mkdir $i; done |
This file contains hidden or 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
/** | |
I've been using promises a lot lately after my first dance in callback hell. | |
I have not read (but did skim) any of the specs nor do I intend too. I also find the bedtime stories about | |
promises cute but far to wordy when I'm in a hurry. | |
So I decided to type up this for future reference, when next time I chain some promises together and am completly confused as | |
to why they don't work the way I expect. | |
Think of promises like an asynchronous try, catch, finally |
This file contains hidden or 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 q = require('q'); | |
require('must'); | |
var keystone; | |
var sockets = []; | |
beforeEach(function(done) { | |
require.cache = {}; | |
keystone = require('keystone'); |
This file contains hidden or 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 http = require('http'); | |
var q = require('q'); | |
require('must'); | |
var server; | |
var sockets = []; | |
beforeEach(function(done) { | |
server = http.createServer(); | |
server.listen(8000, done); |
This file contains hidden or 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
module.exports = { | |
name: 'patientForm', | |
controls: [{ | |
type: 'text', | |
name: 'name[first]', | |
label: { | |
id: 'name[first]', | |
name: 'Name' | |
}, |
This file contains hidden or 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
<form class="form-horizontal"> | |
<fieldset> | |
<!-- Form Name --> | |
<legend>Contact</legend> | |
<div class="form-group"> | |
<label class="col-md-4 control-label" for="textinput">Name</label> | |
<div class="col-md-4"> | |
<input id="textinput" name="textinput" placeholder="placeholder" class="form-control input-md" type="text"> |
This file contains hidden or 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 app = angular.module('myApp', []); | |
app.directive('contactGeneric', function() { | |
return { | |
restrict: 'E', | |
templateUrl: 'contactGeneric.html' | |
}; | |
}); |