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
.shiney_button // Gross but clear class name | |
:background red | |
:border 1px solid black | |
:color white | |
.post input[type=submit] | |
@extend .shiney_button | |
.user input[type=submit] | |
@extend .shiney_button |
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
" Unformatting | |
nmap <silent><leader>u :s/\v(\S+)@<=\s+/ /g<CR> | |
vmap <silent><leader>u J :s/\v(\S+)@<=\s+/ /g<CR> |
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
def search_options | |
options = { | |
:engagement_end_date_gte => Time.zone.now.to_date, | |
:hotel_state_id_is => @state_id | |
} | |
options[:hotel_city_id_is] = @city_id if @city_id.present? | |
options | |
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
def search_options | |
{}.tap {|o| | |
o[ :engagement_end_date_gte ] = Time.zone.now.to_date | |
o[ :hotel_state_id_is ] = @state_id | |
o[ :hotel_city_id_is ] = @city_id if @city_id.present? | |
} | |
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
def today_is date | |
now = Time.zone.parse date | |
today = now.to_date | |
Time.zone.stub!( :now ).and_return( now ) | |
Time.stub!( :now ).and_return(now) | |
Date.stub!( :today ).and_return( today ) | |
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
javascript:(function(){ window.open( 'http://chart.apis.google.com/chart?cht=qr&chs=512x512&chl=' + document.location.href,'qrcodepopup','width=700,height=700') })(); |
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
def rhyme_with(expected) | |
simple_matcher do |given, matcher| | |
matcher.description = "rhyme with #{expected.inspect}" | |
matcher.failure_message = "expected #{given.inspect} to rhyme with #{expected.inspect}" | |
matcher.negative_failure_message = "expected #{given.inspect} not to rhyme with #{expected.inspect}" | |
given.rhymes_with? expected | |
end | |
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
<html> | |
<head> | |
<script type="text/javascript"> | |
function SayChain(previous) { | |
var current = this; | |
this.previous = previous; | |
this.then = function(text) { |
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
# spec/tags.rb | |
Tag.define :foo do | |
# ... | |
end | |
Tag.define /logged_in_as_(.*)/ do |role_name| | |
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
class Foo | |
override_method :method_name, :hash => 'skdjsfghkjwehgvkjervgjwehgvkjhgwejv', :with => :my_method | |
override_method :method_name, :hash => 'skdjsfghkjwehgvkjervgjwehgvkjhgwejv' do | |
end | |
override_method :method_name, :hash => ['skdjsfghkjwehgvkjervgjwehgvkjhgwejv', '2345678956785678d7sfs7fdsfds'] do | |
end |