Skip to content

Instantly share code, notes, and snippets.

View boutell's full-sized avatar

Tom Boutell boutell

View GitHub Profile
0 info it worked if it ends with ok
1 verbose cli [ 'node', '/Users/boutell/npm/bin/npm', 'publish' ]
2 info using [email protected]
3 info using [email protected]
4 verbose node symlink /usr/local/bin/node
5 verbose publish [ '.' ]
6 verbose cache add [ '.', null ]
7 verbose cache add spec="." args=[".",null]
8 verbose cache add local package /Users/boutell/src/apostrophe-snippets
9 silly lockFile 3a52ce78- .
for(var i = begin; i <= end; i++) {
pushOne(i);
}
function pushOne(i) {
q.push({name: 'Artist: ' + i}, function (err) {
console.log('wla' + i)
whop.lookupArtist(i)
});
}
@boutell
boutell / gist:e63e2f7cc7d418b2dc19
Created September 8, 2014 16:11
Area with lots of controls needing icons
{{ aposArea(page, 'content2', {
controls: [
'Bold',
'Italic',
'Underline',
'Strike',
'Subscript',
'Superscript',
'RemoveFormat',
'NumberedList',
@boutell
boutell / network-generator.js
Created November 8, 2014 16:36
Network generators in javascript
/* jshint node:true */
var generators = {};
function range(first, last) {
var c = {
first: first,
last: last,
now: first,
step: function(c) {
@boutell
boutell / gist:e2acfca73490f1328242
Created December 7, 2014 17:00
nginx reverse proxy for node app in which nginx serves static files directly. Also multiprocess-ready with round robin load balancing.
upstream upstream-EXAMPLE {
server localhost:3000;
# To use additional cores, edit your data/port file
# to read 3000 3001 3002 3003, and list the rest
# of them here too (commented out in this example).
# Your site will listen on one port per process
# automatically. Requires latest deployment files
# as found in sandbox
#server localhost:3001;
#server localhost:3002;
@boutell
boutell / reverse-linked-list.js
Created February 16, 2015 12:27
Reversing a linked list in JavaScript
var list = {
name: 'bob',
next: {
name: 'dick',
next: {
name: 'harry'
}
}
};
cd /opt/stagecoach/apps/fandm/current
node app fandm:refresh-directory --parallel=4
@boutell
boutell / gist:0f29e90a7199e40a1df0
Created March 1, 2015 23:46
middleware to unify req.body, req.query, req.params as req.params
app.use(function(req, res, next) {
var params = {};
_.merge(params, req.body || {}, req.query || {}, req.params || {});
req.params = params;
return next();
});
@boutell
boutell / gist:2554ff5dfe244413a9d9
Created October 26, 2015 17:47
YAML escaping options
# YAML supports quotation marks
label: "$Revision: 115 $LastChangedDate: 2015-10-26 11:52:27 -0400 (Mon, 26 Oct 2015) $"
# YAML supports multiline strings without quotation marks
# The indentation is significant.
label: >
$Revision: 115
$LastChangedDate: 2015-10-26 11:52:27 -0400 (Mon, 26 Oct 2015) $
@boutell
boutell / gist:01d6bda1956a295c3cbf5fe29ef2c330
Created June 10, 2016 19:45
Minify correctly in A2 0.6
// FOR 0.6
module.exports = {
modules: {
'apostrophe-assets': {
minify: true
}
}
};