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
{ | |
"folders": | |
[ | |
{ | |
"follow_symlinks": true, | |
"path": "/path/to/working/dir", | |
"folder_exclude_patterns": [".*","node_modules"], | |
"file_exclude_patterns": [".DS_Store","Thumbs.db"] | |
} | |
], |
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
# 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 |
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
// | |
// 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); | |
}); |
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
// | |
// Main Angular Application | |
// | |
angular.module('MyApp', ['markdown']) | |
.config(function(markdownProvider) { | |
markdownProvider.config({ | |
extensions: ['table','gist'] | |
}); | |
}); |
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 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) { | |
/* |
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 | |
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(){ |
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
// ... | |
io.on('connection', function(socket){ | |
console.log('a user connected'); | |
socket.on('disconnect', function(){ | |
console.log('user disconnected'); | |
}); | |
socket.on('add activity', function(activityName){ |
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 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) { |
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 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) { |
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
// 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