Skip to content

Instantly share code, notes, and snippets.

# routes.rb
resources :clients do
resources :payments
end
# views/clients/index.html.haml
= link_to 'New Payment', new_client_payment_path(client)
# controllers/payments_controller.rb
def new
flat_namespace -lruby.1.9.1 -lsybdb -lpthread -ldl -lobjc
ld: in /Developer/SDKs/MacOSX10.6.sdk/usr/local/lib/libiconv.2.dylib, missing required architecture x86_64 in file
collect2: ld returned 1 exit status
make: *** [tiny_tds.bundle] Error 1
flat_namespace -lruby.1.9.1 -lsybdb -lpthread -ldl -lobjc
ld: in /Developer/SDKs/MacOSX10.6.sdk/usr/local/lib/libiconv.2.dylib, missing required architecture x86_64 in file
collect2: ld returned 1 exit status
make: *** [tiny_tds.bundle] Error 1
@ezkl
ezkl / benchpress.md
Created February 7, 2011 02:29
Nokogiri HTML Parsers - BenchPress Results

Nokogiri Parser Comparisons

Author: Ezekiel Templin
Date: February 06, 2011
Summary: Comparing Nokogiri's parsers

System Information

Operating System:    Mac OS X 10.6.6 (10J567)

CPU: Intel Core i7 2.66 GHz

@ezkl
ezkl / ua_collection.rb
Created March 15, 2011 15:58
Collect UA's from UserAgentString. Store in Redis.
require "ohm"
require "typhoeus"
require "nokogiri"
Ohm.connect
class UserAgent < Ohm::Model
attribute :user_agent
index :user_agent
@ezkl
ezkl / gist:1059685
Created July 2, 2011 02:25
distance_of_time_ago & time_ago_in_words
ruby-1.9.2-p180 :018 > class Ack
ruby-1.9.2-p180 :019?> include ActionView::Helpers::DateHelper
ruby-1.9.2-p180 :020?> end
=> Ack
ruby-1.9.2-p180 :021 > dh = Ack.new
=> #<Ack:0x00000101dfb018>
ruby-1.9.2-p180 :022 > dh.time_ago_in_words("2011-05-05 19:49:46")
=> "about 1 month"
ruby-1.9.2-p180 :023 > dh.distance_of_time_in_words_to_now("2011-05-05 19:49:46")
=> "about 1 month"
@ezkl
ezkl / update_textmate.sh
Created July 2, 2011 08:09
Textmate SVN update
#!/usr/bin/env bash
mkdir -p /Library/Application\ Support/TextMate/
sudo chown -R $(whoami) /Library/Application\ Support/TextMate
cd /Library/Application\ Support/TextMate/
if [[ -d Bundles/.svn ]] ; then
cd Bundles && svn up
@ezkl
ezkl / float.sh
Created July 7, 2011 10:44
Floating
#!/usr/bin/env bash
echo $1 + $2 | bc
@ezkl
ezkl / Color Picker Pro_2011-09-14-181210_ezkl.crash
Created September 14, 2011 22:14
Color Picker Pro Crash Log
Process: Color Picker Pro [35572]
Path: /Applications/Color Picker Pro.app/Contents/MacOS/Color Picker Pro
Identifier: com.fructivity.colorpickerpro
Version: 1.0.1 (1.0.1)
Code Type: X86-64 (Native)
Parent Process: launchd [331]
Date/Time: 2011-09-14 18:12:04.444 -0400
OS Version: Mac OS X 10.6.8 (10K549)
Report Version: 6
@ezkl
ezkl / git-remote-output.md
Created September 27, 2011 19:47 — forked from bcg5017/new remote -v
The output of `git remote -v`

fetch is where you update from

git fetch origin master == fetch any updates from the remote repository called origin's master branch.

OR

git pull origin master == fetch any updates AND merge them into mine

origin	git@github.com:ezkl/code.ipsrvcs.com.git (fetch)

push is where you put your updates