This file contains hidden or 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> |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
# Used to create time and datetime formatting short cuts. Search for to_formatted_s in the api | |
# Also see http://snippets.dzone.com/posts/show/2406 | |
# If time = Time.local(2009,12,24,15,30,27) | |
Time::DATE_FORMATS[:datetime] = "%H:%M %d-%b-%Y" # time.to_s(:datetime) ----> 15:30 24-Dec-2009 | |
Time::DATE_FORMATS[:date] = "%d-%b-%Y" # time.to_s(:date) ----> 24-Dec-2009 | |
Time::DATE_FORMATS[:time] = "%H:%M" # time.to_s(:time) ----> 15:30 | |
Time::DATE_FORMATS[:google] = "%Y-%m-%d %H:%M:%S" # time.to_s(:google) ----> 2009-12-24 15:30:27 |
NewerOlder