View Sublime Project
{ | |
"folders": | |
[ | |
{ | |
"follow_symlinks": true, | |
"path": "/path/to/working/dir", | |
"folder_exclude_patterns": [".*","node_modules"], | |
"file_exclude_patterns": [".DS_Store","Thumbs.db"] | |
} | |
], |
View .bash_profile
# Git Auto Complete | |
# install these in home (~) directory. | |
# https://github.com/git/git/blob/8976500cbbb13270398d3b3e07a17b8cc7bff43f/contrib/completion/git-completion.bash | |
# https://github.com/git/git/blob/8976500cbbb13270398d3b3e07a17b8cc7bff43f/contrib/completion/git-prompt.sh | |
if [ -f ~/.git-completion.bash ]; then | |
source ~/.git-completion.bash | |
fi | |
if [ -f ~/.git-prompt.sh ]; then | |
source ~/.git-prompt.sh |
View gist:db629606a4ad31af212b
// | |
// Note that Articles is a $resource pointing to a express RESTful API | |
// | |
angular.module('App') | |
.controller('ArticlesEditController', ["$scope", "$routeParams", "$location", "Articles", | |
function($scope, $routeParams, $location, Articles) { | |
$scope.article = Articles.get({id: $routeParams.id},function(_data) { | |
_data.publish_date = new Date(_data.publish_date); | |
}); |
View app.js
// | |
// Main Angular Application | |
// | |
angular.module('MyApp', ['markdown']) | |
.config(function(markdownProvider) { | |
markdownProvider.config({ | |
extensions: ['table','gist'] | |
}); | |
}); |
View middleware-test.js
var middleware = require('middleware'), // the Middleware you want to test | |
httpMocks = require('node-mocks-http'), // quickly sets up REQUEST and RESPONSE to be passed into Express Middleware | |
request = {}, // define REQUEST | |
response = {} // define RESPONSE | |
; | |
describe('Middleware test', function(){ | |
context('Valid arguments are passed', function() { | |
beforeEach(function(done) { | |
/* |
View app.js
var | |
express = require('express'), | |
app = express(), | |
server = require('http').Server(app), | |
io = require('socket.io')(server) | |
; | |
app.use( express.static(__dirname + '/public') ); | |
server.listen(3030, function(){ |
View app.js
// ... | |
io.on('connection', function(socket){ | |
console.log('a user connected'); | |
socket.on('disconnect', function(){ | |
console.log('user disconnected'); | |
}); | |
socket.on('add activity', function(activityName){ |
View app.js
var express = require('express'), | |
app = express(), | |
port = process.env.PORT || 3030, | |
myModule = require('./myModule') | |
; | |
app.get('/', function(request, response, next) { | |
myModule("Hello World").done(function(result) { | |
response.json(result); | |
}).fail(function(error) { |
View app.js
var express = require('express'), | |
app = express(), | |
port = process.env.PORT || 3030, | |
myModule = require('./myModule') | |
; | |
app.use(express.static(__dirname + '/public')); | |
app.get('/', function(request, response, next) { | |
myModule("Hello World", function(error, result) { |
View get_document.js
// ASSUME JQUERY | |
var document_cache = []; | |
function getDocument(documentId) { | |
var _deferred = new $.Deferred() | |
_document_sent = false; // Note that this could be removed by using `_deferred.state()` | |
; | |
// Iterate over the document_cache array |
OlderNewer