Skip to content

Instantly share code, notes, and snippets.

View danhodos's full-sized avatar

Dan Hodos danhodos

  • GitHub
  • New York, NY
View GitHub Profile

Keybase proof

I hereby claim:

  • I am danhodos on github.
  • I am danhodos (https://keybase.io/danhodos) on keybase.
  • I have a public key whose fingerprint is 7E3A 8CBE 883A 790E 156C 90B9 69D1 6078 8348 DADA

To claim this, I am signing this object:

- (void)recalculateCartPrices {
ODCCart *currentCart = [ODCOrder currentOrder].cart;
NSNumberFormatter *formatter = [NSNumberFormatter new];
[formatter setNumberStyle:NSNumberFormatterCurrencyStyle];
self.cartShippingAndHandlingLabel.text = [formatter stringFromNumber:currentCart.shippingCost];
[self repositionLabel:self.cartShippingAndHandlingLabel];
self.cartSubtotalLabel.text = [formatter stringFromNumber:currentCart.subtotalCost];
[self repositionLabel:self.cartSubtotalLabel];
@danhodos
danhodos / npcr.textile
Created April 20, 2012 22:05
nation pizza code review

Hello, friends.

As promised, here is a code review of the Nation Pizza site. Overall, very nice job! When reading my comments below, please bear in mind that I don’t know the entire context of this project, so I may well be unaware of certain constraints that render my suggestions moot. Still, hopefully there’s some items of use in this-here unordered list!

Cheers,
Dan.

HTML

  • The meta charset tag should be directly after the opening head tag; most browsers will re-start parsing the page after encountering this tag.
1.9.3p0 :073 > json
=> "[{\"hello\":\"2011-01-01 00:00:00.0\"}]"
1.9.3p0 :074 > JSON.load(json)
=> [{"hello"=>"2011-01-01 00:00:00.0"}]
1.9.3p0 :075 >
1.9.3p0 :076 > Crack::JSON.parse(json)
Psych::SyntaxError: (<unknown>): couldn't parse YAML at line 0 column 25
from /Users/dan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/psych.rb:154:in `parse'
from /Users/dan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/psych.rb:154:in `parse_stream'
from /Users/dan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/psych.rb:125:in `parse'
@danhodos
danhodos / init.sh
Created August 21, 2010 21:56 — forked from atmos/init.sh
#!/bin/sh
ruby -e "$(curl -fsS http://gist.github.com/raw/323731/install_homebrew.rb)"
echo "PATH=/usr/local/bin:/usr/local/share/npm/bin:/Developer/usr/bin:\$PATH; export PATH" >> ~/.profile
source ~/.profile
echo "Your path is now $PATH"
brew install git
brew update
# installing mysql
# THIS MAY BE OUT OF DATE.
# Gets rake to shut up about all the files that are being run in the current
# test suite. Also removes "Loaded suite" and "Started" messages.
#
# Warnings/deprecation notices are still shown, though, as they may contain
# valuable information!
require 'rake'
require 'test/unit/ui/console/testrunner'