Skip to content

Instantly share code, notes, and snippets.

@ryanbriones
ryanbriones / gist:607166
Created October 2, 2010 01:57
A Path to Mastering Web Development with Ruby Abstract

A Path to Mastering Web Development with Ruby

The Internet has shifted the path of the would be developer. The web has become so ubiquitous that building web applications has become the status quo. The neutrality of the medium, the web browser, makes it easy for developers to get started easily and provides a tight feedback loop for disciplined practitioners. Equally so, the invention of Rails has simplified this path in many ways for us and brought a lot of excitement to the web development industry. Rails and its ecosystem have changed the way we think about web development.

So it would seem that a new developer looking to break in would look to Rails and its simplicity as a foundation to train and build upon. This, I believe, is flawed.

In this session, I will provide you with some of the tools you need to begin practicing web development with Ruby building upon the principles of web development and an understanding the HTTP. Using this knowledge, we will begin to put some of the more popular Ruby web

module TemporarilyExtend
def self.track_method(klass, method)
@methods ||= {}
@methods[klass] ||= []
@methods[klass] << method
end
def self.tracked_methods(klass)
@methods ||= {}
@methods[klass]
@ryanbriones
ryanbriones / gist:581476
Created September 15, 2010 20:59
don't read too much into this...
module Procable
def to_proc
klazz = self
Proc.new { |*args| klazz.new(*args).run }
end
end
class MyIterator
extend Procable
--type-add
ruby=.haml,.sass,.rake,.rjs,.erb
Capybara.current_session.driver.current_session.instance_eval { @rack_mock_session }.cookie_jar
class WrappedError < StandardError
attr_reader :original_error, :message_with_original_error
def initialize(original_error = nil)
@original_error = original_error
end
def message
# mcp:(~) ryanbriones$ irb
>> require 'redis'
=> true
>> r = Redis.new
=> #<Redis::Client:0x1005d86e8 @timeout=5, @thread_safe=nil, @port=6379, @host="127.0.0.1", @pubsub=false, @db=0, @binary_keys=nil, @logger=nil, @password=nil, @sock=nil>
>> r.set("test1", "foo")
=> "OK"
>> r.set("test2", "bar")
=> "OK"
>> r.mget(["test1", "test2"])
heroku config --long | ruby -pe "\$_ = \$_.gsub(/(\w+)\s+=> (.+)/, 'export \1=\2')" > /tmp/$$ && source /tmp/$$; rm /tmp/$$
def mask(x)y=x.dup;y[6,6]='*'*6;y;end
var Timezone = {
set : function() {
var date = new Date();
date.setTime(date.getTime() + (1000*24*60*60*1000));
var expires = "; expires=" + date.toGMTString();
document.cookie = "timezone=" + (-date.getTimezoneOffset() * 60) + expires + "; path=/";
}
}