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
# 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 |
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> |
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 'typhoeus' | |
LoadError: Could not open library 'libcurl': libcurl: cannot open shared object file: No such file or directory. | |
Could not open library 'libcurl.so': /lib/i386-linux-gnu/libssl.so.1.0.0: symbol CRYPTO_memcmp, version OPENSSL_1.0.0 not defined in file libcrypto.so.1.0.0 with link time reference | |
from /home/rob/.rvm/gems/ruby-1.9.3-p286@DbpediaConceptSearch/gems/ffi-1.1.5/lib/ffi/library.rb:121:in `block in ffi_lib' | |
from /home/rob/.rvm/gems/ruby-1.9.3-p286@DbpediaConceptSearch/gems/ffi-1.1.5/lib/ffi/library.rb:88:in `map' | |
from /home/rob/.rvm/gems/ruby-1.9.3-p286@DbpediaConceptSearch/gems/ffi-1.1.5/lib/ffi/library.rb:88:in `ffi_lib' | |
from /home/rob/.rvm/gems/ruby-1.9.3-p286@DbpediaConceptSearch/gems/typhoeus-0.4.2/lib/typhoeus/curl.rb:405:in `<module:Curl>' | |
from /home/rob/.rvm/gems/ruby-1.9.3-p286@DbpediaConceptSearch/gems/typhoeus-0.4.2/lib/typhoeus/curl.rb:6:in `<module:Typhoeus>' | |
from /home/rob/.rvm/gems/ruby-1.9.3-p286@DbpediaConceptSearch/gems/typhoeus-0.4.2/lib/typhoeus/curl.rb:5:in |
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
jQuery <span id='jquery_version'></span> | |
<%= javascript_tag do %> | |
var jQueryVersion = jQuery.fn.jquery; | |
$('#jquery_version').html(jQueryVersion); | |
<% 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 "net/http" | |
require "rexml/document" | |
class GoogleContactList | |
attr_reader :token | |
attr_accessor :response | |
class << self | |
def cache |
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/base' | |
require 'httpclient' | |
module Geminabox | |
class Hostess < Sinatra::Base | |
%w[/specs.4.8.gz | |
/latest_specs.4.8.gz | |
/prerelease_specs.4.8.gz |
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" |
OlderNewer