Skip to content

Instantly share code, notes, and snippets.

View stefan-lz's full-sized avatar

Stefan Leszkiewicz stefan-lz

  • Orchestrated
  • Melbourne, Australia
View GitHub Profile
@stefan-lz
stefan-lz / youtube-to-mp3.rb
Created June 13, 2012 14:37
youtube vids to mp3 files (ruby)
#!/usr/bin/ruby
#usage: youtube-to-mp3 <youtube-url>
#example: youtube-to-mp3 http://www.youtube.com/playlist?list=PL398CE05652474A1E
#desc: downloads a single youtube vid or a playlist, then converts to mp3.
# Requires youtube-dl and ffmpeg
url = ARGV[0]
system("youtube-dl -citA #{url}")
@stefan-lz
stefan-lz / librato_metric_sound.rb
Last active December 21, 2015 10:38
Play a notifying sound every time a librato count metric is logged. Inspired by https://choir.io/
#!/usr/bin/env ruby
require 'librato/metrics'
POLL_TIME = 5
METRIC_NAME = 'production.rates-service'
def play_sound
`mpg123 cashreg1.wav`
end