Install git-completion to ~/.git-completion.sh
and
git-prompt to ~/.git-prompt.sh
.
Then set up
~/.bash_profile
Install git-completion to ~/.git-completion.sh
and
git-prompt to ~/.git-prompt.sh
.
Then set up
~/.bash_profile
// An example of a controller that would require the enums | |
var enums = require('./enums')(); // Get a singleton | |
/** | |
* Assuming a page isn't served before the asynchronous data is returned | |
* this should give us cached data | |
*/ | |
var get = function(req, res) { | |
res.render('page', { tags: enums.getTags() }); | |
} |
Save and run as sort.js with a list of integers as arguments
node sort.js 1 3 2 9 3 22
output
[ 1, 2, 3, 3, 9, 22 ]
var models = require('./models');
var utils = require('./utils');
var config = require('./config');
models.Order.find({}, function(err, results) {
console.log('models.Order.find type of datetime',results[0].attributes.datetime);
console.log('type of datetime', typeof results[0].attributes.datetime);
});
Tables
Table restaurants
Column | Type
-----------------------+--------------------------
id | integer
Table contacts
Column | Type
Declare actions.js
var scheduler = require('../lib/scheduler');
scheduler.registerAction('make-call', function(job, done) {
twilio.makeCall(job.data, function(error) {
if (error) {
logger.error('Could not place call for job #' + job.id, error);
done('failed');
} else {
// Step 1: npm install heapdump | |
// Step 2: Paste this snippet in your main | |
// app to create heap snapshots that you | |
// can view in the chrome profiler | |
require('heapdump'); | |
setInterval(function() { | |
process.kill(process.pid, 'SIGUSR2'); | |
}, 15000); |
-webkit-font-smoothing: antialiased; | |
-moz-osx-font-smoothing: grayscale; | |
text-rendering: optimizeLegibility; | |
line-height: 1.5em; |
// monkey patches dirac with ./plugins folder | |
var dirac = require('dirac'); | |
modules.exports = function(options) { | |
options = options || {}; | |
// plugins folder contains table folders, each containing plugin definitions | |
fs.readDir(options.path || './plugins'); | |
// pseudocode |