- You can start anywhere in the Castro, Mission (home of the burrito), or downtown. I'd recommend starting at Chow at Market & Church or The Pork Store on 16th at Valencia. If you wanted to go upscale on the weekend, Maverick at 17th and Mission is a fantastic brunch. Another option is to start in Chinatown (just north of Union Squre) for dim sum.
- From Castro take one of the N, J, etc. trains (every light rail train route in the city intersects at Church and Market) down to the Powell Street station. From the Mission you can take BART a couple of stops up to Powell Street.
- Once at Powell Street hop on the Powell Street trolley. A quintessential SF experience.
- Take the trolley up through the city where it will eventually stop at Lombard Street, which is known as the most crooked street in the world. Walk down the hill, take a few pictures and laugh at the tourists trying to drive down the damn thing.
- Once at the bottom of the hill, turn left. You'll be walking towards the w
FriendlyId uses Rails's extending method to avoid overwriting your model's find
method. Internally this is implemented similar to this:
def self.friendly
all.extending(friendly_id_config.finder_methods)
end
This however comes with a performance impact, because extending
invokes Ruby's extend
, which blows away MRI's method cache. To work around this, FriendlyId lets you include a :finders
module which overrides your model's find
to increase performance.
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/compile.c b/compile.c | |
index 9ff3bf5..306fd80 100644 | |
--- a/compile.c | |
+++ b/compile.c | |
@@ -172,10 +172,10 @@ r_value(VALUE value) | |
(((rb_iseq_t*)DATA_PTR(iseq))->filepath) | |
#define NEW_ISEQVAL(node, name, type, line_no) \ | |
- new_child_iseq(iseq, (node), (name), 0, (type), (line_no)) | |
+ new_child_iseq(iseq, (node), rb_str_frozen_literal(name), 0, (type), (line_no)) |
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
" These VIM rules match the MRI C indentation rules. | |
" | |
" To enable use of this project specific config, add the following to your | |
" ~/.vimrc: | |
" | |
" " Enable per-directory .vimrc files | |
" set exrc | |
" " Disable unsafe commands in local .vimrc files | |
" set secure |
Hi there!
The docker cheat sheet has moved to a Github project under https://github.com/wsargent/docker-cheat-sheet.
Please click on the link above to go to the cheat sheet.
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 'action_mailer' | |
require 'mail' | |
module ActionMailer | |
class Base | |
def clean_address(str) | |
EmailAddress.parse(str, :no_default_name => true).quoted rescue str | |
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
#!/usr/bin/env ruby | |
rss = '.+?Rss:\s+(\d+)' | |
share = '.+?Shared_Clean:\s+(\d+)' | |
share << '.+?Shared_Dirty:\s+(\d+)' | |
priv = '.+?Private_Clean:\s+(\d+)' | |
priv << '.+?Private_Dirty:\s+(\d+)' | |
MEM_REGEXP = /\[heap\]#{rss}#{share}#{priv}/m | |
def mem_usage() |
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 "https://rubygems.org" | |
gem 'sprockets' | |
gem 'sprockets-sass' | |
gem 'sass' | |
gem 'compass' | |
gem 'bootstrap-sass' | |
gem 'handlebars_assets' | |
gem 'coffee-script' |
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 Test | |
module Unit | |
TestCase = RSpec::Core::ExampleGroup | |
end | |
end | |
class Test::Unit::TestCase | |
def self.inherited(host) | |
host.set_it_up host.name.gsub(/(Spec|Test)/,'') | |
def host.method_added(name) |
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
EventMachine::Hiredis::Connection#receive_data | |
Hiredis::Reader#feed <0.000003> | |
Hiredis::Reader#gets | |
Encoding.default_external <0.000002> | |
String#force_encoding <0.000002> | |
Encoding.default_external <0.000001> | |
String#force_encoding <0.000001> | |
Encoding.default_external <0.000000> | |
String#force_encoding <0.000001> | |
Encoding.default_external <0.000001> |