Skip to content

Instantly share code, notes, and snippets.

@ezkl
ezkl / float.sh
Created July 7, 2011 10:44
Floating
#!/usr/bin/env bash
echo $1 + $2 | bc
@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 / 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 / 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 / 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

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
# 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

Keybase proof

I hereby claim:

  • I am ezkl on github.
  • I am ezkl (https://keybase.io/ezkl) on keybase.
  • I have a public key whose fingerprint is 91BF 46AE 245B 6C2D BE1D 4941 5DD5 6A61 906E 14CC

To claim this, I am signing this object: