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
| server = Thread.new do | |
| rack = Rack::Server.new(:Port=>8000) | |
| # rack 1.2 ignores the :app option, force it manually: | |
| rack.instance_variable_set('@app', Rack::Directory.new(Rails.root.join('test/javascript'))) | |
| rack.start | |
| end | |
| sleep(0.5) | |
| Launchy.open("http://localhost:8000/index.html") | |
| server.join |
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 RailsLogInterpolator | |
| def before_step(step) | |
| @current_step = step | |
| Rails.logger.info("{{{ #{step.name}") | |
| end | |
| def before_step_result(keyword, step_match, multiline_arg, status, exception, source_indent, background) | |
| Rails.logger.info(" #{@current_step.name} }}}\n") | |
| 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
| <object data="http://boos.audioboo.fm/swf/playlist_player.swf" height="350" type="application/x-shockwave-flash" width="300"> | |
| <param name="movie" value="http://boos.audioboo.fm/swf/playlist_player.swf"> | |
| <param name="scale" value="noscale"><param name="salign" value="TL"> | |
| <param name="align" value="left"><param name="allowScriptAccess" value="always"> | |
| <param name="wmode" value="transparent"><param name="quality" value="best"> | |
| <param name="FlashVars" value="rssURL=http://audioboo.fm/tag/londonriots.atom"> | |
| <param name="loop" value="false"><param name="allowFullScreen" value="false"> | |
| <a href="http://audioboo.fm/tag/londonriots">Listen on audioboo.fm!</a> | |
| </object> |
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 'selenium-webdriver' | |
| require 'rack' | |
| require 'rack/handler/thin' | |
| class IframeServer | |
| def start | |
| @pid = fork { Rack::Handler::Thin.run(self, :Port => 9292) } | |
| poller = Selenium::WebDriver::SocketPoller.new("localhost", 9292, 30) | |
| raise "could not start #{self.inspect}" unless poller.connected? |
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 'capybara' | |
| require 'rack' | |
| class IframeServer | |
| def call(env) | |
| r = Rack::Request.new(env) | |
| content = case r.path | |
| when '/container.html' | |
| pages[0] | |
| when '/iframe1.html' |
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
| #!/bin/sh | |
| # Auto-applies changes from the index to a previous commit | |
| # eg | |
| # git add foo | |
| # git autofix HEAD~3 | |
| #!/bin/sh | |
| target="$(git rev-parse $1)" |
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
| $ git clone https://github.com/keithclark/selectivizr.git | |
| Cloning into selectivizr... | |
| remote: Counting objects: 131, done. | |
| remote: Compressing objects: 100% (112/112), done. | |
| remote: Total 131 (delta 48), reused 0 (delta 0) | |
| Receiving objects: 100% (131/131), 28.41 KiB, done. | |
| Resolving deltas: 100% (48/48), done. | |
| $ cd selectivizr/ | |
| $ git config --global core.autocrlf true | |
| $ git rm --cached -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
| #!/usr/bin/env ruby | |
| require 'rubygems' | |
| require 'open-uri' | |
| require 'json' | |
| # Clone a github repo, add all forks as remotes: | |
| # $ git clone https://github.com/rails/rails.git | |
| # $ cd rails | |
| # $ git add-github-forks |
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
| diff --git a/lib/acts_as_taggable_on/acts_as_taggable_on/core.rb b/lib/acts_as_taggable_on/acts_as_taggable_on/core.rb | |
| index 5e9bdaa..fc51c2d 100644 | |
| --- a/lib/acts_as_taggable_on/acts_as_taggable_on/core.rb | |
| +++ b/lib/acts_as_taggable_on/acts_as_taggable_on/core.rb | |
| @@ -197,20 +197,21 @@ module ActsAsTaggableOn::Taggable | |
| else | |
| scope = scope.group("#{ActsAsTaggableOn::Tag.table_name}.#{ActsAsTaggableOn::Tag.primary_key}") | |
| end | |
| scope.all |
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
| NSString *requiredIOS = @"4.0"; | |
| NSString *currentIOS = [[UIDevice currentDevice] systemVersion]; | |
| // Blocks are kinda available but broken and unsupported on 3.2 - just test the version number to see if we have block support | |
| ABBlocksSupported = (CFStringCompare((CFStringRef)currentIOS, (CFStringRef)requiredIOS, kCFCompareNumerically) != kCFCompareLessThan); |