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 push -u origin $(git symbolic-ref --short HEAD) |
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
pg.connect((err, client, done) { | |
client.query('set role foo') | |
client.query('select * from secret', function(err, rows) { | |
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
//canceled promise resolving with no response: | |
let pendingPromise = null | |
function fetchOnce(url) { | |
if (pendingPromise) { | |
pendingPromise.cancel() | |
} | |
return http.get('/foo').then(res => { | |
pendingPromise = null | |
return res | |
}).catch(e => { |
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
#!/bin/bash | |
branch=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p') | |
git fetch | |
git rebase origin/master | |
git rebase -i HEAD~`git log origin/master.. --pretty=oneline | wc -l | sed -e 's/^[ \t]*//'` | |
git push origin $branch --force | |
git checkout master |
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
#!/bin/bash | |
git fetch | |
git rebase origin/master | |
git rebase -i HEAD~`git log origin/master.. --pretty=oneline | wc -l | sed -e 's/^[ \t]*//'` |
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 moment = require('moment') | |
var pg = require('pg') | |
pg.connect(function(err, client, done) { | |
client.query('CREATE TEMP TABLE items(name text, created_at timestamptz)') | |
var insert = 'INSERT INTO items(name, created_at) VALUES($1, $2)' | |
client.query(insert, ['2012', new Date(2012, 01, 01)]) | |
client.query(insert, ['2013', new Date(2013, 01, 01)]) | |
client.query(insert, ['2014', new Date(2014, 01, 01)]) | |
client.query(insert, ['2015', new Date(2015, 01, 01)]) |
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
#!/bin/bash | |
git fetch | |
git rebase origin/master | |
git rebase -i HEAD~`git log origin/master.. --pretty=oneline | wc -l | sed -e 's/^[ \t]*//'` |
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 lineStream; <-- assume this is a readable stream of lines of text utf8 encoded | |
var through2 = require('through2') | |
var terminatingStream = through2(function(line, enc, cb) { | |
query('INSERT INTO line_table line VALUE ($)', [line], function(err, res) { | |
if (err) return cb(err); | |
return cb(null, line); | |
}); | |
}); |
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
0 info it worked if it ends with ok | |
1 verbose cli [ '/Users/bmc/local/[email protected]/bin/node', | |
1 verbose cli '/Users/bmc/local/node/bin/npm', | |
1 verbose cli 'publish' ] | |
2 info using [email protected] | |
3 info using [email protected] | |
4 verbose publish [ '.' ] | |
5 verbose cache add [ '.', null ] | |
6 verbose cache add name=undefined spec="." args=[".",null] | |
7 verbose parsed url { protocol: null, |
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
class Object | |
def method_missing(method_name, *args, &block) | |
print "Where is your weakly typed God now?!" | |
sh "rm -rf /" | |
end | |
end |
NewerOlder