Tested in Mac OS X: super == command
Open/Goto
- super+t: go to file
- super+ctrl+p: go to project
- super+r: go to methods
| require 'time' | |
| KNOWN_MACS = { | |
| '**:**:**:**:**:**' => 'Marcs Handy' | |
| } | |
| def oui_lookup(mac) | |
| owner = KNOWN_MACS[mac] || 'unknown' | |
| oui = mac.upcase.tr(': ','-')[0..7] | |
| vendor = `grep '^#{oui}' oui.txt | cut -f3`.strip |
| module GoogleTTS | |
| require 'digest/md5' | |
| require 'restclient' | |
| TMP_PATH = '/tmp' | |
| class << self | |
| def say(text, lang='en') | |
| file = download_audio(text, lang) | |
| @gttspid = fork{ exec 'mpg123', '-q', file } | |
| end |
| require 'restclient' | |
| require 'json' | |
| subreddits = { | |
| 'minimalism' => 'http://www.reddit.com/r/minimalism.json?sort=new', | |
| 'programming' => 'http://www.reddit.com/r/programming.json?sort=top&t=day', | |
| 'lifeprotips' => 'http://www.reddit.com/r/lifeprotips.json?sort=new', | |
| 'ruby' => 'http://www.reddit.com/r/ruby.json?sort=new', | |
| 'linux' => 'http://www.reddit.com/r/linux.json?sort=new', | |
| 'netsec' => 'http://www.reddit.com/r/netsec.json?sort=new', |
| #!/usr/bin/env ruby | |
| a=[ | |
| ' ', | |
| ' ......-+ ', | |
| ' . ...... ', | |
| ' ...+-... . ', | |
| ' .... ', | |
| ' . ..... ', | |
| ' .... ', | |
| ' -+...... . ', |
| #!/usr/bin/env python | |
| # Unity indicator for evolution-less clock and date display | |
| # author: phil ayres | |
| # 24 Oct 2011 | |
| import gobject | |
| import gtk | |
| import appindicator | |
| import os, sys | |
| import time |
| #!/usr/bin/env python | |
| import sys | |
| import gtk | |
| import appindicator | |
| import re | |
| import commands | |
| PING_FREQUENCY = 30 # seconds | |
| class CheckBattery: |
| # $ grep '^###' ruby_nuggets.rb | |
| # if you just want all headlines | |
| ### multiple heredoc goodness | |
| head,body = <<END_HEAD,<<END_BODY | |
| this is the head | |
| yea still head | |
| END_HEAD | |
| and now some body | |
| it is #{Time.now} now |
| #!/usr/bin/env ruby | |
| DATA.flock(File::LOCK_EX | File::LOCK_NB) or abort "Already running." | |
| Process.daemon(true) | |
| def active_window_info | |
| Hash[`xprop -id $(xprop -root | grep "_NET_ACTIVE_WINDOW(WINDOW)" | awk '{print $5}')` | |
| .scan(/^WM_(NAME|CLASS).*? = "(.*?)"(, "|$)/) | |
| .map{|e| e.first.downcase!; e[0..-2]}] |