Skip to content

Instantly share code, notes, and snippets.

View noahhendrix's full-sized avatar

Noah Hendrix noahhendrix

View GitHub Profile
@joestump
joestump / San_Francisco.mkd
Created February 1, 2014 02:05
Here are two tours of San Francisco and the surrounding area. Both take about a day. One is entirely within the city and can be done entirely via public transportation. The other requires a car and gets you outside of SF to some of the wonderful sites that comprise the Yay Area.

San Francisco by Foot

  • 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
$ = jQuery
$.fn.lineHeight or= ->
if height = @data('lineHeight')
return height
# Create a hidden div with the same font
# properties, then measure its height
$shadow = $('<span />')
$shadow.css({
# MAC manipulators
alias random_mac='sudo ifconfig en0 ether `openssl rand -hex 6 | sed "s/\(..\)/\1:/g; s/.$//"`'
alias restore_mac='sudo ifconfig en0 ether YOUR_ORIGINAL_MAC_ADDRESS_GOES_HERE'
@mislav
mislav / procs-vs-lambda.md
Last active March 26, 2021 18:34
Jim Weirich on the differences between procs and lambdas in Ruby

Jim Weirich:

This is how I explain it… Ruby has Procs and Lambdas. Procs are created with Proc.new { }, lambdas are created with lambda {} and ->() {}.

In Ruby 1.8, proc {} creates lambda, and Ruby 1.9 it creates procs (don't ask).

Lambdas use method semantics when handling parameters, procs use assignment semantics when handling parameters.

This means lambdas, like methods, will raise an ArgumentError when called with fewer arguments than they were defined with. Procs will simply assign nil to variables for arguments that were not passed in.

@mbleigh
mbleigh / gist:3894298
Created October 15, 2012 18:45
How to use LetterOpener with Pony
require 'pony'
Pony.options = {
:via => :smtp,
:from => "Somebody <notifications@example.com>"
}
if ENV['RACK_ENV'] == 'development'
require "letter_opener"
Pony.options.merge!({
via: LetterOpener::DeliveryMethod,
@noahhendrix
noahhendrix / .agignore
Last active February 28, 2017 21:59
dotfiles
log
tags
tmp
@mbleigh
mbleigh / Gemfile
Created March 21, 2012 03:14
Non-Rails Rackup with Sprockets, Compass, Handlebars, Coffeescript, and Twitter Bootstrap
source "https://rubygems.org"
gem 'sprockets'
gem 'sprockets-sass'
gem 'sass'
gem 'compass'
gem 'bootstrap-sass'
gem 'handlebars_assets'
gem 'coffee-script'