Skip to content

Instantly share code, notes, and snippets.

@noeticpenguin
noeticpenguin / mr_status_bar_app.rb
Created December 15, 2011 12:13 — forked from rubiojr/mr_status_bar_app.rb
MacRuby StatusBar Application
#
# Initialize the stuff
#
# We build the status bar item menu
def setupMenu
menu = NSMenu.new
menu.initWithTitle 'FooApp'
mi = NSMenuItem.new
mi.title = 'Hellow from MacRuby!'
mi.action = 'sayHello:'
@noeticpenguin
noeticpenguin / gist:1428039
Created December 3, 2011 20:20 — forked from jonathanpenn/gist:1428002
Blip prompt
# Prompt Setup
YELLOW='\[\033[1;33m\]'
BLUE='\[\033[1;34m\]'
GREEN='\[\033[1;32m\]'
RED='\[\033[0;31m\]'
NORMAL='\[\033[00m\]'
WHITE='\[\033[0;37m\]'
function minutes_since_last_commit {
@noeticpenguin
noeticpenguin / gist:1242452
Created September 26, 2011 15:09 — forked from ndbroadbent/gist:1218804
ruby1.9.2-p290 w/ Require performance patch.
curl https://raw.github.com/gist/1008945/4edd1e1dcc1f0db52d4816843a9d1e6b60661122/ruby-1.9.2p290.patch > /tmp/ruby-1.9.2p290.patch
rvm install ruby-1.9.2-p290 --patch /tmp/ruby-1.9.2p290.patch
@noeticpenguin
noeticpenguin / switch.rb
Created May 12, 2011 15:32 — forked from jbr/switch.rb
ruby 1.9.2 case-like switch
# In response to:
# http://mlomnicki.com/ruby/tricks-and-quirks/2011/02/10/ruby-tricks2.html
# Ruby 1.9.2 has some neat stuff that lets us make a readable
# alternative case statement that calls each method in turn.
# 1.9.2 features used:
# * hashes are ordered in 1.9.2
# * cool JSON-style hash syntax
# * concise lambda syntax