Skip to content

Instantly share code, notes, and snippets.

View crohr's full-sized avatar
➡️
Checkout PullPreview.com and RunsOn.com

Cyril Rohr crohr

➡️
Checkout PullPreview.com and RunsOn.com
View GitHub Profile
@crohr
crohr / gist:25fb820c76b5c1c603d2
Last active August 29, 2015 14:04 — forked from flomotlik/gist:6212725
curl vs wget

We have changed our check_url implementation from curl to wget for three reasons

  1. It gives us the ability to retry on connection refused. Compare the command we used previously with curl:
curl -sSfL --retry 3 URL

to the current one:

class Tunnel < Thor
method_options :environment => "development", :aliases => "-e", :desc => "Config environment"
desc "start", "Start an ssh tunnel"
def start
random_hi_port = rand(30000) + 30000
identity_part = tunnel['identity_file'] ? "-i #{tunnel['identity_file']}" : ""
ssh_part = "ssh -t #{identity_part} -g -R *:#{random_hi_port}:0.0.0.0:#{tunnel['local_port']} #{tunnel['username']}@#{tunnel['public_host']}"
require 'config/environment.rb'
class GlobalizeCountry < ActiveRecord::Base
end
class GlobalizeLanguage < ActiveRecord::Base
end
class GlobalizeTranslation < ActiveRecord::Base
belongs_to :language, :class_name => "GlobalizeLanguage"
@crohr
crohr / url_dsl.rb
Created December 15, 2009 14:46 — forked from defunkt/url_dsl.rb
require 'open-uri'
# url dsl -- the ultimate url dsl!
#
# You just can't beat this:
#
# $ irb -r url_dsl
# >> include URLDSL
# => Object
# >> http://github.com/defunkt.json