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
function getUrlVars(path) { | |
var vars = {}; | |
var parts = path.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) { | |
vars[key] = value; | |
}); | |
return vars; | |
} |
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 params = { | |
'name' : name, | |
'direction' : 'inbound' | |
}; | |
connection = Twilio.Device.connect( params ); | |
console.log(connection.parameters); | |
connection.error(function(error){ | |
console.log("connection error!"); |
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
Array.prototype.remove = function(itemToRemove) { | |
var i = 0; | |
while (i < this.length) { | |
if (this[i] == itemToRemove) { | |
this.splice(i,1) | |
} else { | |
i++; | |
} | |
} | |
return this; |
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 max = 0; | |
jQuery("label").each(function(){ | |
if ($(this).width() > max) max = $(this).width(); | |
}); | |
jQuery("label").width(max); |
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 boxCoord = function(endCoord) { | |
var coord = endCoord; | |
return function(anotherCoord) { | |
return [anotherCoord, coord]; | |
} | |
} | |
$('body').mousedown(function(e){ | |
var thate = e; | |
$(this).mouseup(function(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
set nocompatible | |
syntax on | |
filetype plugin indent on | |
set tabstop=4 | |
set shiftwidth=4 | |
set expandtab | |
set number | |
set sts=4 | |
set smarttab | |
set autoindent |
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
alias savehistory="history | cut -c7- >> ~/history.save; sort -u ~/history.save >> ~/history.save.tmp; rm ~/history.save; mv ~/history.save.tmp ~/history.save" | |
alias remember="cat ~/history.save | grep" |
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
namlet@odin:~$ ssh -vvv -A fapestniegd.xen.prgmr.com | |
OpenSSH_5.1p1 Debian-5, OpenSSL 0.9.8g 19 Oct 2007 | |
debug1: Reading configuration data /etc/ssh/ssh_config | |
debug1: Applying options for * | |
debug2: ssh_connect: needpriv 0 | |
debug1: Connecting to fapestniegd.xen.prgmr.com [173.245.73.171] port 22. | |
debug1: Connection established. | |
debug1: identity file /home/namlet/.ssh/identity type -1 | |
debug1: identity file /home/namlet/.ssh/id_rsa type -1 | |
debug1: identity file /home/namlet/.ssh/id_dsa type -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
if (isset($_SERVER['HTTP_ACCEPT'])) { | |
// normalize things like "application/json; charset=utf-8" to application/json | |
foreach ($acceptedContentTypes as $contentType) { | |
if (strpos(strtolower($_SERVER['HTTP_ACCEPT']), $contentType) !== false) { | |
$_SERVER['HTTP_ACCEPT'] = $contentType; | |
$this->setContentType($contentType); | |
break; | |
} | |
} | |
} |
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
brahma:shindig nathanloyer$ git status | |
# On branch master | |
# Changes to be committed: | |
# (use "git reset HEAD <file>..." to unstage) | |
# | |
# modified: content/sampledata/canonicaldb.json | |
# | |
# Unmerged paths: | |
# (use "git reset HEAD <file>..." to unstage) | |
# (use "git add/rm <file>..." as appropriate to mark resolution) |
NewerOlder