Skip to content

Instantly share code, notes, and snippets.

@youpy
Last active August 29, 2015 13:56
Show Gist options
  • Save youpy/9185559 to your computer and use it in GitHub Desktop.
Save youpy/9185559 to your computer and use it in GitHub Desktop.
Disable sleep (for OS X)
reuire 'mac-robot'
r = Mac::Robot.new
loop {
# 0xff is not listed in <HIToolbox/Events.h>, so it doesn't affect user's interaction
# http://forums.macrumors.com/showpost.php?p=8428116&postcount=2
r.key_press(0xff)
sleep 60
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment