This file contains hidden or 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 five = require('johnny-five') | |
, board | |
, pot | |
, button, buttonStatus | |
, pin = 9 // starting pin | |
, animation | |
board = new five.Board(); | |
var speed = 100 |
This file contains hidden or 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
_ _ _ _ | |
__ _____| | | __| | ___ _ __ ___ | | | |
\ \ /\ / / _ \ | | / _` |/ _ \| '_ \ / _ \ | | | |
\ V V / __/ | | | (_| | (_) | | | | __/ |_| | |
\_/\_/ \___|_|_| \__,_|\___/|_| |_|\___| (_) | |
## . |
This file contains hidden or 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
// Click the Invisible Cow hacks | |
// CTIC doesn't use jQuery, so selectors and triggering events are dirty funky native | |
// I initially tried simply $('#cow').click(); to no avail | |
// Instead, I wrote a function to simulate clicks and then we can click on the cow by passing its position to the function | |
function simulateClick(x, y) { | |
var clickEvent = document.createEvent('MouseEvents'); | |
clickEvent.initMouseEvent( | |
'click', true, true, window, 0, | |
0, 0, x, y, false, false, | |
false, false, 0, null |
This file contains hidden or 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
// C'mon, Axe. Get your act together. return Axe.writesBadCode(); // always returns true | |
// http://moffdub.files.wordpress.com/2009/01/2609_2768.jpg | |
var self = this; | |
var get = { | |
a: { | |
girlfriend: (function() { console.log('derp'); }) | |
} | |
} |
This file contains hidden or 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 opened = true // toggle | |
, map_width | |
, side_panel_width | |
, OPEN_SIDEBAR_WIDTH = 30 | |
, MAX_MAP_WIDTH = 100 | |
var self = this; | |
$("#toggle").on('click', function() { | |
This file contains hidden or 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
zergling:rails-haiti-map zipp$ pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start | |
server starting | |
# check my app, 'could not connect to server: Connection refused' | |
# is pg running? px aux | grep pg says no | |
zergling:rails-haiti-map zipp$ pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start --log=derp.txt | |
server starting | |
zergling:rails-haiti-map zipp$ cat derp.txt | |
FATAL: database files are incompatible with server |
This file contains hidden or 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
# stream a compressed backup file into a local database using pipes | |
ssh -C zipp@remote_ip 'cat ~/backupfile.sql.gz' | gunzip -dc | mysql -u root -D database |
This file contains hidden or 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 fs = require('fs') | |
fs.readFile(process.argv[2], function(err, file) { | |
if (err) return err; | |
console.log(file.toString().split('\n').length - 1); | |
}); |
This file contains hidden or 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
# enter password twice even though no prompt exists. find a better way! | |
mysqldump -h $HOST -u $USERNAME -p $PRODUCTION_DB_NAME | mysql -h $HOST -u $USERNAME -p $ARCHIVE_DB_NAME |
This file contains hidden or 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 fs = require('fs') | |
, path = require('path') | |
fs.readdir(process.argv[2], function(err, list) { | |
for (var k = 0; k < list.length; k++) { | |
var name = list[k]; | |
if (path.extname(name) == '.' + process.argv[3]) console.log(name); | |
} | |
}); |