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
MacRubyHTTP.post("https://our.application.url.com", { | |
:payload => some_json_payload, | |
:headers => { 'Content-Type' => 'application/json' }) do |lh| | |
NSLog(lh.inspect) | |
end |
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
module Faraday | |
class Adapter | |
class EMHttpRequest < Faraday::Adapter | |
self.supports_parallel_requests = true | |
def self.setup_parallel_manager(options = {}) | |
EMParallelManager.new | |
end | |
class EMParallelManager |
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
render: function(username) { | |
var self = this; | |
this.repositories.fetch({ success: function() { | |
var content = this.templates.list({ | |
builds_list_title: "Recent Builds", | |
repositories: Travis.Collections.Repositories.toJSON() | |
}); | |
self.el.fadeOut('fast', function() { |
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
# Dev with custom destroy taking extra params | |
class DeveloperWithCustomDestroyMethod < ActiveRecord::Base | |
self.table_name = 'developers' | |
has_and_belongs_to_many :projects, :join_table => 'developers_projects', :foreign_key => 'developer_id' | |
def destroy(options ={}) | |
super | |
end | |
end |
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
diff --git a/lib/list.ex b/lib/list.ex | |
index 75778f7..10d6cf7 100644 | |
--- a/lib/list.ex | |
+++ b/lib/list.ex | |
@@ -1,5 +1,13 @@ | |
object List | |
- def +(another) | |
+ % Returns a new list with the contents of the | |
+ % current list and the other list. | |
+ % |
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
require 'bigdecimal' | |
class Payment | |
FEE_PERCENTAGE = BigDecimal.new('2.9') | |
FEE_SET_AMOUNT = BigDecimal.new('0.15') | |
attr_reader :amount | |
def initialize(amount) | |
@amount = BigDecimal.new(amount.to_s) |
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
def root_binding | |
binding | |
end | |
module Blah | |
def self.root_binding | |
@root_binding | |
end |
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
# - TS related capistrano tasks | |
require "vendor/plugins/thinking-sphinx/lib/thinking_sphinx/deploy/capistrano" | |
require 'new_relic/recipes' | |
set :stages, %w(staging production) | |
set :default_stage, "staging" | |
require 'capistrano/ext/multistage' | |
# Global deployment information |
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
/opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.0.rc.5/lib/bundler/runtime.rb:27:in `setup': You have already activated gemcutter 0.5.0, but your Gemfile requires gemcutter 0.6.1. Consider using bundle exec. (Gem::LoadError) | |
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.0.rc.5/lib/bundler/spec_set.rb:12:in `each' | |
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.0.rc.5/lib/bundler/spec_set.rb:12:in `each' | |
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.0.rc.5/lib/bundler/runtime.rb:17:in `setup' | |
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.0.rc.5/lib/bundler.rb:95:in `setup' | |
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.0.rc.5/lib/bundler/cli.rb:292:in `exec' | |
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.0.rc.5/lib/bundler/vendor/thor/task.rb:22:in `send' | |
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.0.rc.5/lib/bundler/vendor/thor/task.rb:22:in `run' | |
from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.0.rc.5/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task' | |
from /o |
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
source :rubygems | |
gemspec |