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 'curb' | |
| client = Curl::Easy.new('http://bit.ly/fleakr') do |config| | |
| config.follow_location = true | |
| config.max_redirects = 5 | |
| end | |
| client.http_head |
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 'snip_snap' | |
| require 'hpricot' | |
| module Rack | |
| # = Rack::Snapshot | |
| # | |
| # Takes the image tags in your page and expands them using some of the popular | |
| # image sharing services. Currently supports these services: | |
| # |
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 'cucumber' | |
| require 'capybara' | |
| require 'capybara/cucumber' | |
| require 'capybara/session' | |
| Before do | |
| Capybara.current_driver = :selenium |
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 Validatable | |
| def save | |
| false | |
| end | |
| def save! | |
| false | |
| 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
| #!/bin/bash | |
| branch=`git status | head -n1 | cut -d' ' -f4` | |
| rake cruise && git checkout master && git merge $branch && rake cruise && git push |
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 'sinatra' | |
| require 'etsy' | |
| enable :sessions | |
| Etsy.access_mode = :read_write | |
| Etsy.api_key = "key" | |
| Etsy.api_secret = "secret" | |
| Etsy.callback_url = "http://localhost:4567/verify" |
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
| var Inspector = function(target) { | |
| var inspector = this, | |
| target = target; | |
| function padding(indentationLevel) { | |
| paddingText = ''; | |
| for (var i = 0; i < indentationLevel; i++) { | |
| paddingText += ' '; | |
| } |
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/bash | |
| open "/Applications/Google Chrome.app" --args \ | |
| -user-agent="Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A543a Safari/419.3" |
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 Credential | |
| include ActiveModel::Validations | |
| attr_accessor :screen_name, :oauth_token, :oauth_secret, :token, :description | |
| validates_presence_of :screen_name, :oauth_token, :oauth_secret, :message => 'required' | |
| validate :user_exists, :unless => :errors? | |
| def initialize(attributes = {}) | |
| attributes.each {|k, v| set_recognized_attribute(k, v) } |
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 Activity < ActiveRecord::Base | |
| # columns: | |
| # * entity_id | |
| # * entity_type | |
| # * action | |
| # * created_at | |
| belongs_to :entity, :polymorphic => true | |
| end |