git clone git://gist.github.com/923934.git redisearch
cd redisearch
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
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Cross-browser kerning-pairs & ligatures</title> | |
<style> | |
body { font-family: sans-serif; background: #f4f3f3; color: rgba(40, 30, 0, 1); width: 500px; margin: 80px auto; padding: 0px; } | |
a { color: rgba(15, 10, 0, 0.8); text-decoration: none; border-bottom: 1px solid; padding: 1px 1px 0px; -webkit-transition: background 1s ease; } | |
a:hover { background: rgba(0, 220, 220, 0.2); } | |
p, li { line-height: 1.5; padding: 0em 1em 0em 0em; margin: 0em 0em 0.5em; } |
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
$ ruby -v | |
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-darwin10.4.0] | |
$ ruby bench_erubis_slim_haml.rb | |
Rehearsal --------------------------------------------------------------------------------------- | |
empty loop 0.000000 0.000000 0.000000 ( 0.001055) | |
erubis 2.690000 0.000000 2.690000 ( 2.697228) | |
slim 4.200000 0.010000 4.210000 ( 4.196183) | |
haml 3.1.0.alpha.14 (Bleeding Edge) 19.660000 0.040000 19.700000 ( 19.681350) | |
haml (ugly) 3.1.0.alpha.14 (Bleeding Edge) 18.940000 0.070000 19.010000 ( 19.004186) |
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
namespace :cache do | |
BUCKET = 'bucketname' | |
desc "start aws" | |
task :aws do | |
require 'aws/s3' | |
AWS::S3::Base.establish_connection!( | |
access_key_id: 'key', | |
secret_access_key: 'secret' |
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
$ rvm use 1.8.7-p302 | |
$ wget http://subversion.tigris.org/downloads/subversion-1.6.15.tar.gz | |
$ tar -xzf subversion-1.6.15.tar.gz && cd subversion-1.6.15 | |
$ ./configure --with-ruby-sitedir=~/.rvm/rubies/ruby-1.8.7-p302/lib/ruby --without-berkeley-db | |
$ make swig-rb && make install-swig-rb | |
To test things out: | |
$ irb | |
ruby-1.8.7-p302 > require 'svn/client' | |
=> true |
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
describe("accessibility", function () { | |
beforeEach(function(){ | |
var ac = $('#menu1').menu(); | |
var item0 = $("li:eq(0) a"); | |
}); | |
it("should has menu class", function(){ | |
expect(ac.hasClass("ui-menu ui-widget ui-widget-content ui-corner-all")).toEqual(true); | |
}); |
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
# Selection sort (very slow on large lists) | |
a = [9,8,6,1,2,5,4,3,9,50,12,11] | |
n = a.size - 1 | |
n.times do |i| | |
index_min = i | |
(i + 1).upto(n) do |j| | |
index_min = j if a[j] < a[index_min] |
First install the required gems:
gem install octokit awesomeprint rainbow
Then run it to extract all of your open GitHub issues into files (with comments).
ruby my-gh-issues.rb
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
# spec/acceptance/support/javascript.rb | |
RSpec.configure do |config| | |
config.use_transactional_fixtures = false | |
config.before :each do | |
Capybara.current_driver = :selenium if example.metadata[:js] | |
if Capybara.current_driver == :rack_test | |
DatabaseCleaner.strategy = :transaction | |
else | |
DatabaseCleaner.strategy = :truncation |
OlderNewer