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 'eventmachine' | |
| require 'sorted_set_adapter' | |
| class BadJob | |
| def set | |
| @set ||= SortedSetAdapter.new | |
| end | |
| def process_item |
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 'rubygems' | |
| require 'bundler/setup' | |
| require 'koala' | |
| facebook_yaml = File.open File.expand_path( '../facebook.yml', __FILE__ ) | |
| tokens = YAML::load facebook_yaml | |
| page_access_token = tokens['page_access_token'] | |
| test_page_id = tokens['test_page_id'] |
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 'rubygems' | |
| require 'bundler/setup' | |
| require 'koala' | |
| facebook_yaml = File.open File.expand_path( '../facebook.yml', __FILE__ ) | |
| tokens = YAML::load facebook_yaml | |
| page_access_token = tokens['page_access_token'] | |
| test_page_id = tokens['test_page_id'] |
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
| module AcceptanceHelper | |
| def sign_in(user=Factory.create(:user)) | |
| visit new_user_session_path | |
| fill_in 'user_email', :with => user.email | |
| fill_in 'user_password', :with => user.password | |
| click_button 'Sign in' | |
| end | |
| end | |
| RSpec.configure do |config| |
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 'date' | |
| # Arco - (Ar)chive (Co)de | |
| class Arco | |
| def initialize(arguments) | |
| @start = Time.now | |
| @source = arguments[0] |
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
| public class SampleClass | |
| { | |
| private readonly ISessionFactory _sessionFactory; | |
| public SampleController(ISessionFactory sessionFactory) { | |
| _sessionFactory = sessionFactory; | |
| } | |
| public void DoSomething() { | |
| using(var session = _sessionFactory.OpenSession()) { |
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 | |
| name = ARGV[0] | |
| raise ArgumentError, "You must provide a project name" if name.nil? | |
| def run(cmd) | |
| `#{cmd}` | |
| 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
| User.new rescue e; puts e.backtrace.join("\n") |
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
| # Alias each_line to each so your ruby 1.8 code will still | |
| # work in 1.9 | |
| unless ''.respond_to?(:each) | |
| String.class_eval do | |
| alias_method :each, :each_line | |
| 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
| # my refactored rails watchr script | |
| ENV["WATCHR"] = "1" | |
| system 'clear' | |
| def growl(message) | |
| growlnotify = `which growlnotify`.chomp | |
| title = "Watchr Test Results" | |
| image = image_path(message) |