Skip to content

Instantly share code, notes, and snippets.

View veezus's full-sized avatar

Veez Remsik veezus

View GitHub Profile
def new_resource
resource = resource_service.new(params[resource_name])
resource.user = current_user
resource
end
def problem_kind_abbr
if problem_kind == "selection"
"PSS_"
elsif problem_kind == "selection"
"SER_"
else-
"???_"
end
end
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]')
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>
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)$
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
describe "something else" do
let(:dealer) { Fabricate(:dealer) }
it { p dealer.id } #=> 38
it { p dealer.id } #=> 39
end
# ~/.bashrc.local
alias watch="watchr ~/.watchr.rb"
# ~/.watchr.rb
if File.exists?(".rspec")
@spec = 'rspec'
else
@spec = 'spec'
end
hcd dotmatrix
git fetch
git co -t origin/testify
./bin/hlink
. ~/.hashrc
hcd <project>
SAYIT=loud testify # => and then save a test!
set wildmenu " allow tab to cycle through found options
set wildmode=list:longest