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 | |
# SSH into a Vagrant VM, forwarding ports in a way that allows node within Vagrant to be debugged by a debugger | |
# or IDE in the host operating system. Don't know why, but Vagrantfile port forwarding does not work. | |
# (https://groups.google.com/forum/#!topic/vagrant-up/RzPooJ0dp6Q) | |
/usr/bin/vagrant ssh-config > $TMPDIR/vagrant-ssh-config | |
ssh -F $TMPDIR/vagrant-ssh-config -L 5858:127.0.0.1:5858 default | |
rm $TMPDIR/vagrant-ssh-config |
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
/** | |
* Allow other processes to execute while iterating over | |
* an array. Useful for large arrays, or long-running processing | |
* | |
* @param {Function} fn iterator fed each element of the array. | |
* @param {Function} next executed when done | |
*/ | |
Array.prototype.nonBlockingForEach = function(fn, next) { | |
var arr = this; | |
var i = 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
10 HGR2: HCOLOR=3 | |
11 R0 = 70 | |
12 TAU = 6.282 | |
13 SCREENX = 279: SCREENY = 191 | |
15 CENTERX = INT(SCREENX / 2): CENTERY = INT(SCREENY / 2) | |
16 LINEDOTS = 3 | |
17 R = R0 | |
18 CIRCUM = TAU*R0: S = 1 | |
19 J = 0: | |
20 REM J-LOOP |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 | |
# Find dependency changes in a branch in a scala project using sbt. | |
# You have to have the https://github.com/jrudolph/sbt-dependency-graph plugin installed. | |
# the standard `sed` on Mac OS X won't work, so make sure to install GNU sed via brew. | |
branch="$1" |
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
/** | |
* Retry a promise until success, up to a certain number of times. | |
* Returns the last error if it reaches maximum attempts. | |
* | |
* @param maxTries {Number} positive integer | |
* @param p {Promise} | |
* @return {Promise} | |
*/ | |
function retry (maxTries, p) { | |
var tries = 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
#!/bin/bash | |
git filter-branch --force --index-filter \ | |
"git rm -r --cached --ignore-unmatch $1" \ | |
--prune-empty --tag-name-filter cat -- --all |
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
'use strict'; | |
var Q = require('q'); | |
// `condition` is a function that returns a boolean | |
// `body` is a function that returns a promise | |
// returns a promise for the completion of the loop | |
function promiseWhile(condition, body) { | |
var done = Q.defer(); |
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
#!/usr/bin/env perl -w | |
# | |
# This program is meant to help me focus, by blocking timewasting sites in /etc/hosts. | |
# | |
# If the program is invoked with 'focus on', a section will be added to the /etc/hosts file | |
# routing requests for the domains in __DATA__ to localhost. | |
# | |
# If the program is invoked with 'focus off', that section is removed. | |
# |
NewerOlder