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
IRB.conf[:PROMPT_MODE] = :SIMPLE | |
IRB.conf[:ECHO] = false |
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
[ | |
// goto line | |
{ "keys": ["super+l"], "command": "show_overlay", "args": {"overlay": "goto", "text": ":"} }, | |
// goto method | |
{ "keys": ["super+shift+t"], "command": "show_overlay", "args": {"overlay": "goto", "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
describe "#visible_for_user?" do | |
let(:owner) { FactoryGirl.create(:user) } | |
let(:other_user) { FactoryGirl.create(:user) } | |
let(:private_content) { FactoryGirl.build(:private_content, :project => owner.default_project) } | |
let(:public_content) { FactoryGirl.build(:public_content, :project => owner.default_project) } | |
specify { private_content.should be_visible_for_user(owner) } | |
specify { private_content.should_not be_visible_for_user(other_user) } | |
specify { public_content.should be_visible_for_user(owner) } | |
specify { public_content.should be_visible_for_user(other_user) } | |
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
# loop do | |
# start = Time.now | |
# `curl -s http://staging.torial.com` | |
# puts "Requested in #{Time.now - start}s" | |
# end | |
[...] | |
Requested in 0.148879s | |
Requested in 0.137547s | |
Requested in 0.165125s |
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
### Gemfile | |
group :test do | |
gem "rspec" | |
gem "capybara" | |
# ... | |
end | |
### spec_helper.rb |
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
$(window).load(function() { | |
// config | |
var cyan = "#009fee"; | |
var white = "#ffffff"; | |
var paperCenterX = $(window).width() / 2; | |
// timings | |
var lineFadeInTime = 2000; | |
var whiteGFadeInTime = 2000; |
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
# original ApplicationController | |
class ApplicationController | |
def home_page? | |
"original" | |
end | |
end | |
puts ApplicationController.new.home_page? | |
# => original |
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
hash1 = %w(cat dog wombat).each_with_object({}) do |item, memo| | |
memo[item] = item.upcase | |
end | |
p hash1 | |
# => {"cat"=>"CAT", "dog"=>"DOG", "wombat"=>"WOMBAT"} | |
hash2 = %w(cat dog wombat).inject({}) do |memo, item| | |
memo[item] = item.upcase | |
memo |
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 'open-uri' | |
#uri = "http://www.zeldman.com/wp-content/themes/zeldman-v2/style.css?0111110710" | |
#uri = "http://asset2.betterplace.org/stylesheets/screen.css?1299172234" | |
uri = 'http://www.xing.com/css/v/144/general.min.css' | |
def parse_css_colors(uri) | |
file = open(uri).read | |
hex_colors = file.scan(/#[a-f0-9]{3,6}/i) |
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
http://zenadmin.org/en | |
http://railfrog.com/ | |
http://www.geegocms.com/ | |
http://nanoc.stoneship.org/ | |
http://slatecms.wvu.edu/ | |
http://rubricks.org/index_en.html | |
http://code.google.com/p/palani/ | |
http://agilewebdevelopment.com/plugins/station | |
http://intraducibles.com/projects/typus |