Skip to content

Instantly share code, notes, and snippets.

View xoebus's full-sized avatar
🤖
beep beep

Christopher Brown xoebus

🤖
beep beep
  • San Francisco, CA
View GitHub Profile
@xoebus
xoebus / buildfile.rb
Created March 14, 2012 01:17 — forked from seadowg/buildfile
Add growl 1.3 to buildr
# Add this to a buildr 'buildfile' to receive growl notifications when compilation
# completes or fails (including cc compilations)
require 'ruby_gntp'
# Growl setup
Buildr.application.on_completion do |title, message|
GNTP.notify({
:app_name => "buildr",
:title => title,
// Welcome to hell... and the reason
// for the ability to embed variables
// in strings. Yes, this is effectively the
// same as just writing the damn thing out.
// And yes, I did generate this code - I'm not
// that insane.
outputBottleStatement(int numBottles) {
if (numBottles == 99) {
print("99 bottles of beer on the wall, 99 bottles of beer.");
@xoebus
xoebus / ask.rb
Created September 15, 2010 14:51
def ask(question, default=nil, valid = /.*/, multiline=false)
output = question
output << " [#{default}]" unless default.nil?
output << " (Optional)" if valid =~ ""
output << ": "
puts output
matches = false
answer = default