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
#!/bin/bash | |
# usage: $0 source_dir [source_dir] ... | |
# where source_dir args are directories containing git repositories | |
red="\033[00;31m" | |
green="\033[00;32m" | |
yellow="\033[00;33m" | |
blue="\033[00;34m" | |
purple="\033[00;35m" |
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
class VersionStruct | |
class << self | |
def build_from(version, args = {}) | |
object = deserialize(version.object) | |
args[:changes] = deserialize(version.object_changes) | |
args[:version] = version | |
version_struct = new(object, args) | |
version_struct.mimic | |
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
class NumberTest < ActiveSupport::TestCase | |
def setup | |
@number = 4 | |
end | |
def test_number_is_four | |
assert_equal 4, @number | |
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
class WorkRequest < ActiveRecord::Base | |
# Attributes include :state_history (text) and :state (string) | |
serialize :state_history, Array | |
after_find :restore_process | |
after_initialize :restore_process | |
def rollback_state_to_previous |
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
class ClassFinder | |
attr_reader :pid | |
def initialize(pid) | |
@pid = pid | |
end | |
def object | |
@object ||= self.class.source_objects.select{|x| x.pid =~ /#{pid}/}.first | |
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
APACHE_ROOT = 'path/to/apache' | |
def apache(location) | |
File.join APACHE_ROOT, location | |
end | |
def apachectl(command) | |
"#{apache 'bin/apachectl'} -k #{command}" | |
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
<% number_of_columns = 2 %> | |
<div class="columns"> | |
<% @things.each_slice((@things.length / number_of_columns.to_f).ceil) do |column_of_things| %> | |
<div class ="column"> | |
<% column_of_things.each do |thing| %> | |
<%= thing.title %> | |
<% end %> | |
</div> | |
<% end %> | |
</div> |
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 'sinatra' | |
require 'rdoc/markup/to_html' | |
get '/' do | |
input_string = "" | |
parser = RDoc::Markup::ToHtml.new | |
File.open("README.rdoc", "r") do |file| | |
file.each_line{|l| input_string << l} | |
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
class Thing | |
def colour | |
'blue' | |
end | |
def who | |
self.class.to_s | |
end | |
def output(line) |
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
<VirtualHost *:80> | |
ServerName localhost | |
DocumentRoot /home/rob/public_html | |
<Directory /home/rob/public_html> | |
Allow from all | |
</Directory> | |
RackBaseURI /self_assessment | |
<Directory /home/rob/web/select_assessment> |
OlderNewer