Chrome
Spotify
Homebrew
Git (brew install git)
Iterm 2
Chrome
Spotify
Homebrew
Git (brew install git)
Iterm 2
var fileUpload = require('file-upload') | |
, gridfsAdapter = require('fileupload-gridfs') | |
var middleware = fileUpload.createFileUpload({ | |
adapter: gridfsAdapter({ dbName: 'mydb' }) | |
}).middleware | |
Exactly the same as this, just a bit nicer for the examples: | |
var middleware = fileUpload.createFileUpload({ |
config defaultToCurrentScreen true | |
config nudgePercentOf screenSize | |
config resizePercentOf screenSize | |
# Push Bindings | |
bind right:ctrl;cmd;alt push right bar-resize:screenSizeX/2 | |
bind left:ctrl;cmd;alt push left bar-resize:screenSizeX/2 | |
bind m:ctrl;cmd;alt move screenOriginX-0;screenOriginY-0 screenSizeX;screenSizeY | |
# Throw Bindings |
var modelNotFoundDelegate = require('../lib/model-not-found-delegate') | |
, modelNotFound = modelNotFoundDelegate(router, collection, debug) | |
router.route('sections/:id/layout(/)', 'editLayout', function (id) { | |
collection.fetch( | |
{ update: true | |
, success: function () { | |
if (modelNotFound(id)) return false | |
var view = new LayoutView({ model: collection.get(id) }) | |
router.render(view, 'Section Layout') |
To allow us to automatically create a good quality changelog from our git history we recommend the following formats for commit messages.
The aim is to capture a reference to any ticket, card, or story that this commit contributes towards.
The most important part is to capture the platform and reference number:
{Platform} #{Reference ID} {Commit Message}
module.exports = downloadAjaxFile | |
function downloadAjaxFile (xhr) { | |
/* jshint maxcomplexity: 7 */ | |
var filename = '' | |
, disposition = xhr.getResponseHeader('Content-Disposition') | |
if (disposition && disposition.indexOf('attachment') !== -1) { | |
var filenameRegex = /filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/ | |
, matches = filenameRegex.exec(disposition) |
DBCollection.prototype.read = function (id) { | |
return this.findOne({ _id: ObjectId(id) }) | |
} | |
DBCollection.prototype.delete = function (id) { | |
return this.remove({ _id: ObjectId(id) }) | |
} | |
function notablescan() { | |
var currentValue = db.getSiblingDB('admin').runCommand({ getParameter: 1, notablescan: 1 }).notablescan |
var assert = require('assert') | |
assert.throws(function () { | |
var a = {} | |
a.b() | |
}, /undefined is not a function/) |
const request = require('request-promise') | |
const cheerio = require('cheerio') | |
request('http://www.bbcgoodfood.com/recipes').then(html => { | |
const $ = cheerio.load(html) | |
var categories = $('a[href^="/recipes/category"]').map(function (i, category) { | |
return { href: $(this).attr('href'), label: $(this).text() } | |
}).filter((i, category) => { | |
return category.label !== 'see more ...' | |
}).toArray() |