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
# Show iTunes information in real-time in the terminal | |
def status | |
cmd = "osascript -e 'tell application \"iTunes\" to player state'" | |
`#{cmd}` | |
end | |
def track_name | |
cmd = "osascript -e 'tell application \"iTunes\" to name of current track'" | |
`#{cmd}` |
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
#!/usr/bin/env ruby | |
# refresh_latex | |
# Automagically re-render LaTeX files and open the result in a PDF reader. | |
# Using Skim we can do all of this without losing focus to the editor, | |
# although I provide code to somewhat accomplish this with Preview.app | |
# | |
# As of right now it only works in OS X since it uses the "open" command. | |
# Feel free to port it to any platform you want to | |
# |
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
chmod +x git-hooks/pending_migrations_check.rb | |
cd .git/hooks | |
ln -is ../../git-hooks/pending_migrations_check.rb post-merge | |
ln -is ../../git-hooks/pending_migrations_check.rb post-checkout |
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
// | |
// loads remote file using fetch() streams and "pipe" it to webaudio API | |
// remote file must have CORS enabled if on another domain | |
// | |
// mostly from http://stackoverflow.com/questions/20475982/choppy-inaudible-playback-with-chunked-audio-through-web-audio-api | |
// | |
function play(url) { | |
var context = new (window.AudioContext || window.webkitAudioContext)(); |