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
#rule, another.rule | |
{ | |
property: value; | |
property: value; | |
xlproperty: value; | |
} |
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
# Let IRB notify you of a long running task, | |
# using blocks. | |
def say(text) | |
system "say", text.to_s | |
end | |
def growl(msg, title = "hallo thar!", sticky = false) | |
args = ["growlnotify", "-n", "irb", "-m", msg, title] | |
args << "-s" if sticky |
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
task :check_revision do | |
unless `git rev-parse HEAD` == `git rev-parse origin/master` | |
puts "" | |
puts " \033[1;33m**************************************************\033[0m" | |
puts " \033[1;33m* WARNING: HEAD is not the same as origin/master *\033[0m" | |
puts " \033[1;33m**************************************************\033[0m" | |
puts "" | |
end | |
end | |
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
# Require RubyGems by default. | |
require 'rubygems' | |
# Require UtilityBelt for lots of functionality | |
# http://utilitybelt.rubyforge.org/ | |
require 'utility_belt' | |
UtilityBelt::Equipper.equip(:defaults) | |
UtilityBelt::Equipper.equip(:with, :string_to_proc, :pipe, :pastie, :not, | |
:language_greps, :is_an, :google, | |
:convertable_to_file, :clipboard, |
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
require 'rake' | |
require 'rake/testtask' | |
require 'rake/rdoctask' | |
desc 'Default: run unit tests.' | |
task :default => :test | |
desc 'Test the transceivers plugin.' | |
Rake::TestTask.new(:test) do |t| | |
t.libs << 'lib' |
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
require 'uri' | |
require 'net/http' | |
require 'xmlsimple' | |
# A Nice wikipedia blabber extension for your amusement | |
module MatzBot::Commands | |
# eh? | |
# needs_gem 'xml-simple' => ['lookup_request'] | |
# gem 'xml-simple' |
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
Goal is => Client.first.items... Can do with finder_sql, but want an activerecord way! | |
class Client < ActiveRecord::Base | |
has_many :contacts | |
has_many :tasks, :through => :contacts | |
has_many :items, :through => :contacts # THIS DOESNT WORK | |
end | |
class Contact < ActiveRecord::Base | |
belongs_to :client |
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
require 'gruff' | |
class GitCommitGraph | |
Author = Struct.new(:name, :email) | |
Commit = Struct.new(:hash, :author, :time, :insertions, :deletions, :files_changed) | |
attr_accessor :time_spacing, :built, :repository, :since, :name, :commit_hash | |
attr_accessor :scale_type, :width, :height, :graph, :graph_type | |
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
gpb2 = "General Purpose Building 2: Lecture Theatre" | |
cssr = "Computer Science Seminar Room" | |
csl1 = "Computer Science Lab 2.01" | |
unit "CITS3201", "Human Computer Interaction" do |u| | |
u.has "Lecture", gpb2 do |e| | |
e.at "Monday, 13:00 for 1 hour" | |
e.at "Wednesday, 14:00 for 1 hour" | |
end |
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
task :check_revision do | |
unless `git rev-parse HEAD` == `git rev-parse origin/master` | |
puts "" | |
puts " \033[1;33m**************************************************\033[0m" | |
puts " \033[1;33m* WARNING: HEAD is not the same as origin/master *\033[0m" | |
puts " \033[1;33m**************************************************\033[0m" | |
puts "" | |
end | |
end |