Skip to content

Instantly share code, notes, and snippets.

@elliottheis
elliottheis / keybase.md
Created April 7, 2017 16:16
keybase verification

Keybase proof

I hereby claim:

  • I am elliottheis on github.
  • I am elliottheis (https://keybase.io/elliottheis) on keybase.
  • I have a public key ASDbfqVOgN9po3Ylll_cQzV4HvEzcLUdEsxyqe4kS_9_Rwo

To claim this, I am signing this object:

var type = function(o){
return !!o && Object.prototype.toString.call(o).match(/(\w+)\]/)[1];
};
# MAC manipulators
alias random_mac='sudo ifconfig en0 ether `openssl rand -hex 6 | sed "s/\(..\)/\1:/g; s/.$//"`'
alias restore_mac='sudo ifconfig en0 ether YOUR_ORIGINAL_MAC_ADDRESS_GOES_HERE'
@elliottheis
elliottheis / terminal-remove-asl-logs
Last active December 14, 2015 02:59
Delete Apple System Logs - speed up Terminal.app
sudo rm -rf /private/var/log/asl/*.asl
@elliottheis
elliottheis / terminalColouring
Created December 31, 2012 00:41
OS X Terminal.app: code to add to bash profile to add colouring
# adds colours to the terminal window
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
@elliottheis
elliottheis / gist:4220102
Created December 5, 2012 22:32
Search for a string in all revisions of entire git history
git rev-list --all | (
while read revision; do
git grep -F 'Your search string' $revision
done
)
@elliottheis
elliottheis / gist:3483066
Created August 26, 2012 19:48
Webkit console.log broken - demo
(function(){
var obj = {};
console.log(obj);
obj.foo = "hello";
console.log(obj);
})();
@elliottheis
elliottheis / gist:2795430
Created May 26, 2012 21:44
iOS mouse event handling
function touchHandler(event) {
var touches = event.changedTouches,
first = touches[0],
type = "";
switch(event.type){
case "touchstart": type = "mousedown";
break;
case "touchmove": type="mousemove";
break;
case "touchend": type="mouseup";
@elliottheis
elliottheis / gist:1975773
Created March 5, 2012 01:16
Facebook email tracking
<span style=3D"">
<img src=3D"http://www.facebook.com/email_open_log_pic.php?mid=3D51178b2G56e57c6dG1f415bcG0" style=3D"border:0;width:1px;height:1px;"/>
<bgsound src=3D"http://www.facebook.com/email_open_log_pic.php?mid=3D51178b2G56e57c6dG1f415bcG0&s=3Da" volume=3D"-10000"/>
</span>
javascript:$('body>div').show()&&$('#mw-sopaOverlay').remove(),void 0;