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
// jshint node:true | |
'use strict'; | |
var semver = require('semver'), | |
exec = require('exec'); | |
module.exports = function(grunt) { | |
'use strict'; | |
require('load-grunt-tasks')(grunt); |
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 MongoClient = require('mongodb').MongoClient; | |
var dbhost = 'mongodb://localhost:27017/test', | |
myCollection = 'myFirstColl'; | |
var seedData = function(db, callback) { | |
db.collection(myCollection).find({}, {}, {}) | |
.toArray( | |
function(err, docs) { | |
if (docs.length <= 0) { |
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
app.engine('handlebars', exphbs.create({ | |
defaultLayout: 'main', | |
layoutsDir: app.get('views') + '/layouts', | |
partialsDir: [app.get('views') + '/partials'] | |
}).engine); | |
app.set('view engine', 'handlebars'); | |
app.use(connect.logger('dev')); | |
app.use(connect.bodyParser({ | |
uploadDir:path.join(__dirname, '../public/upload/temp') |
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'), | |
bodyParser = require('body-parser'), | |
_ = require('underscore'), | |
json = require('./movies.json'), | |
app = express(), | |
request = require('request'); | |
app.set('port', process.env.PORT || 3500); | |
app.use(bodyParser.urlencoded()); |
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
l = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bol d blue)<%an>%Creset' --abbrev-commit --date=relative | |
nuke = "branch --merged | xargs git branch -d" | |
prp = "!f() { git whatchanged origin/master..HEAD; }; f" |
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
Handlebars.registerHelper("select", function(value, options) { | |
return options.fn(this) | |
.split('\n') | |
.map(function(v) { | |
var t = 'value="' + value + '"' | |
return ! RegExp(t).test(v) ? v : v.replace(t, t + ' selected="selected"') | |
}) | |
.join('\n') | |
}) |
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
/** | |
* String.fmt | |
* | |
* String prototype for interpolating positioned arguments into a string. | |
* | |
* @param {Array} args List of strings to be inserted. | |
* @return {String} | |
*/ | |
String.prototype.fmt = function String_fmt() { | |
var args = arguments, |
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
// fileA.js: | |
var something = '12345'; | |
module.exports = { | |
doWork: function() { | |
console.log('working!'); | |
}, | |
someVar: 'yo yo yo!', | |
something: something | |
} |
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
PS1="\n${yellow}$(ruby_version_prompt) ${purple}\h ${reset_color}[${orange}\D{%F %T}${reset_color}] in ${green}\w\n${bold_cyan}$(scm_char)${green}$(scm_prompt_info) ${green}→${reset_color} " |
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
/*! | |
* angular-translate - v2.11.0 - 2016-03-20 | |
* | |
* Copyright (c) 2016 The angular-translate team, Pascal Precht; Licensed MIT | |
*/ | |
!function(a,b){"function"==typeof define&&define.amd? | |
// AMD. Register as an anonymous module unless amdModuleId is set | |
define([],function(){return b()}):"object"==typeof exports? | |
// Node. Does not work with strict CommonJS, but |
OlderNewer