# Anchor
click_link 'Save'
# Button
click_button 'awesome'
# Both above
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
| # Convert any YouTube video into an audio file you can listen to on the go, using: | |
| # http://rg3.github.com/youtube-dl/ | |
| { ~ } > brew install ffmpeg | |
| { ~ } > wget https://raw.github.com/rg3/youtube-dl/2012.02.27/youtube-dl | |
| { ~ } > chmod u+x youtube-dl | |
| # Pick which video format you want to download.. (use any YT video link) | |
| { ~ } > ./youtube-dl -s -F http://www.youtube.com/watch?v=vT1KmTQ-1Os |
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
| Latency Comparison Numbers (~2012) | |
| ---------------------------------- | |
| L1 cache reference 0.5 ns | |
| Branch mispredict 5 ns | |
| L2 cache reference 7 ns 14x L1 cache | |
| Mutex lock/unlock 25 ns | |
| Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
| Compress 1K bytes with Zippy 3,000 ns 3 us | |
| Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
| Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
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
| # Copyright (C) 2011 Anurag Priyam - MIT License | |
| module Jekyll | |
| # Jekyll plugin to generate tag clouds. | |
| # | |
| # The plugin defines a `tag_cloud` tag that is rendered by Liquid into a tag | |
| # cloud: | |
| # | |
| # <div class='cloud'> |
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
| # Resize selenium browser window to avoid Selenium::WebDriver::Error::MoveTargetOutOfBoundsError errors | |
| # | |
| # Example usage with Rspec (in spec/support/spec_helper.rb): | |
| # | |
| # config.before(:each) do | |
| # set_selenium_window_size(1250, 800) if Capybara.current_driver == :selenium | |
| # end | |
| # | |
| def set_selenium_window_size(width, height) | |
| window = Capybara.current_session.current_window.resize_to |
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
| # Credit http://stackoverflow.com/a/2514279 | |
| for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch; done | sort -r |
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
| # in features/support/env.rb | |
| require 'selenium/webdriver' | |
| # we need a firefox extension to start intercepting javascript errors before the page | |
| # scripts load | |
| Capybara.register_driver :selenium do |app| | |
| profile = Selenium::WebDriver::Firefox::Profile.new | |
| # see https://github.com/mguillem/JSErrorCollector | |
| profile.add_extension File.join(Rails.root, "features/support/extensions/JSErrorCollector.xpi") | |
| Capybara::Selenium::Driver.new app, :profile => profile |