⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
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 onAdd = function(data, options) { | |
... | |
options.queueOpts = options.queueOpts || { | |
success: function() { | |
... | |
}, | |
error: function() { | |
... | |
} | |
}; |
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
# config/initializers/source_maps.rb | |
if Rails.env.development? | |
require 'open3' | |
module CoffeeScript | |
class SourceMapError < StandardError; end; | |
class << self | |
def map_dir |
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 application_root = __dirname, | |
express = require("express"), | |
path = require("path"), | |
mongoose = require('mongoose'); | |
var app = express.createServer(); | |
// database | |
mongoose.connect('mongodb://localhost/ecomm_database'); |
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
set list listchars=tab:\ \ ,trail:· |
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
<script src="js/showdown/showdown.js"></script> | |
<script src="js/showdown/extensions/twitter.js"></script> | |
<script src="js/showdown/extensions/google-prettify.js"></script> | |
<script type="text/javascript" src="js/jsv/uri/uri.js"></script> | |
<script type="text/javascript" src="js/jsv/uri/schemes/urn.js"></script> | |
<script type="text/javascript" src="js/jsv/jsv.js"></script> | |
<script type="text/javascript" src="js/jsv/json-schema-draft-03.js"></script> | |
<script type="text/javascript" src="js/jsv/json-schema-draft-02.js"></script> | |
<script type="text/javascript" src="js/jsv/json-schema-draft-01.js"></script> |
Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:
getTweetsFor("domenic", function (err, results) {
// the rest of your code goes here.
});
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 Model = Bones.plugin.models.Server; | |
var Backend = Bones.plugin.backends.Queue; | |
var server = new Model({id:'lorem'}); | |
var queue = new Backend(server, { | |
error: function() { | |
// When an error occurs | |
}, | |
success: function() { |
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 kue = require('kue'); | |
var jobs = kue.createQueue(); | |
job.process('email', function(job done) { | |
console.log(job.data); | |
done.call(this); | |
}); |
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 kue = require('kue'); | |
var jobs = kue.createQueue(); | |
jobs.create('email', { | |
title: 'welcome email for tj' | |
, to: '[email protected]' | |
, template: 'welcome-email' | |
}).save(); |