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
#! /bin/sh | |
function check { | |
if [ $? -ne 0 ] ; then | |
echo "Error occurred getting URL $1;" | |
if [ $? -eq 6 ]; then | |
echo "Unable to reslove host" | |
fi | |
if [ $? -eq 7 ]; then | |
echo "Unable to contact host" |
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
function move(n, from, to, using) | |
{ | |
if (n = 1) | |
print (“Move disk from “, from, “ to “, to); | |
else | |
{ | |
move (n-1, from, using, to); | |
move(1, from, to, using); | |
move(n-1, using, to, from); | |
} |
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
/* | |
* @param Number timecode (milliseconds) | |
* @return String h:m:s (zero padded to two spaces) | |
* Usage: timecodeDisplay(11282000) -> "03:08:02" | |
*/ | |
function timecodeDisplay(timecode) { | |
var seconds = timecode / 1000 % 60; | |
var secondsDisp = (seconds <= 9) ? '0' + seconds : '' + seconds; | |
var minutes = (((timecode / 1000) - seconds) / 60) % 60; | |
var minutesDisp = (minutes <= 9) ? '0' + minutes : '' + minutes; |
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 myPromise = function(arg) { | |
return new Promise(function(resolve, reject) { | |
if (arg === true) { | |
resolve('it\'s all good'); | |
} else { | |
reject('no good, buddy'); | |
} | |
}); | |
} | |
var setting = confirm("Press 'OK' to succeed or 'Cancel' to fail"); |
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
sudo npm cache clean -f | |
sudo npm install -g n | |
sudo n stable |
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
npm list -g --depth=0 |
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
function gcd(a, b) { | |
return c = (b == 0) ? a : gcd (b, a % b); | |
} |
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
sudo lsof -i :80 # checks port 80 |
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
cat vlfiles.txt | grep .js | uniq |
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
svn resolve --accept working -R <path> |