Skip to content

Instantly share code, notes, and snippets.

@jfonte
jfonte / rightway-exception-JS
Created February 7, 2016 16:40
right way to process JS exceptions
try{
whatever
}catch(e){
windows.location.href = "http://stackoverflow.com/search?q=[js]+"+e.message;
}
@jfonte
jfonte / gist:919f46dd67365650d929
Created November 3, 2015 17:09
change the time before disk goes to sleep on Mac OSX to save battery life
sudo pmset -a disksleep 1
sudo pmset -b disksleep 1
@jfonte
jfonte / unmountBak.sh
Last active April 2, 2016 18:04
unmount script superduper
#!/bin/bash
sleep 10 # give SuperDuper enough time to finish doing it's job
/usr/sbin/diskutil umount bak > /dev/null
# if you want to completely eject the disk when waking up to conserve battery life and stop the disk from spinning, then:
# diskutil eject bak (you can get the disk name by running '''diskutil cs list''' source -> http://apple.stackexchange.com/questions/153307/how-can-change-hard-disk-name-not-partition)
@jfonte
jfonte / osx-setup.md
Last active August 29, 2015 14:23 — forked from zenorocha/.hyper.js

Setup Mac OS X

I'm in a hospital in Spain and my MacBook was stolen.

Hospital Commit

Now I bought a new one and need to configure it. I have an external hard drive that backup everything using Time Machine, but I don't want all the crap I had in the old one.

1. Run Software Update