Skip to content

Instantly share code, notes, and snippets.

View veezus's full-sized avatar

Veez Remsik veezus

View GitHub Profile
class Time
alias :minute :min
alias :second :sec
end
def assign_clicked_at
%w(year month day hour minute second).each do |date_part|
self.send("clicked_at_#{date_part}=", created_at.send(date_part))
end
end
veez ~/code/rr09-team-128 (master)$ sudo gem install hashrocket-terraformation
Successfully installed hashrocket-terraformation-0.1.0
1 gem installed
Installing ri documentation for hashrocket-terraformation-0.1.0...
File not found: lib
veez ~/code/rr09-team-128 (master)$
You can use either http://vurl-staging.heroku.com or http://vurl.me for the server name.
veez ~ $ curl --data vurl[url]=http%3A%2F%2Fthing.com http://vurl-staging.heroku.com/vurls.xml
<?xml version="1.0" encoding="UTF-8"?>
<vurl>
<clicks-count type="integer">0</clicks-count>
<created-at type="datetime">2009-08-18T19:17:26-04:00</created-at>
<description></description>
<id type="integer">18</id>
<ip-address>127.0.0.1</ip-address>
bill.description = if description = xml_document.at('titles/title[@type=official]')
description.text
end
bill.description = xml_document.at('titles/title[@type=official]') ? xml_document.at('titles/title[@type=official]').text : nil
bill.description = xml_document.at('titles/title[@type=official]') rescue nil
bill.description = description.text if description = xml_document.at('titles/title[@type=official]')
def problem_kind_abbr
if problem_kind == "selection"
"PSS_"
elsif problem_kind == "selection"
"SER_"
else-
"???_"
end
end
def new_resource
resource = resource_service.new(params[resource_name])
resource.user = current_user
resource
end