This file contains hidden or 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
| Annual Subway Ridership By Station | |
| Source: http://web.mta.info/nyct/facts/ridership/ridership_sub_annual.htm (MTA) (2013) | |
| The Bronx | |
| 38, 161 St-Yankee Stadium, 8,766,012 | |
| 54, 3 Av-149 St, 7,310,115 | |
| 86, Parkchester, 5,215,409 | |
| 110, 149 St-Grand Concourse, 4,427,399 | |
| 122, Fordham Rd, 3,946,955 | |
| 125, Fordham Rd, 3,876,601 |
This file contains hidden or 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
| $.ajaxSetup({ | |
| dataType: "json", | |
| beforeSend: function(xhr) { | |
| xhr.setRequestHeader("accept", "application/json"); | |
| } | |
| }); | |
| $.fetchJSON = function(path) { | |
| return $.ajax({ | |
| url: path, |
This file contains hidden or 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
| Purpose of Incorporation: creating an ideal workplace, free, dynamic, and joyous, where dedicated engineers will be able to realize their craft and skills at the highest possible level. |
This file contains hidden or 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 'date' | |
| birthday = Date.new(1985, 11, 21) | |
| today = Date.today | |
| move = Date.new(2000, 8, 8) | |
| since_birthday = (today - birthday).to_i | |
| since_move = (today - move).to_i | |
| puts "You are #{since_birthday} days old!" | |
| puts "You've been in the USA for #{since_move} days!" |
This file contains hidden or 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
| -- http://xkcd.com/287/ | |
| import Data.List | |
| order menu amount items | |
| | amount < 0 = [] | |
| | amount == 0 = [items] | |
| | otherwise = foldl (\meals (item, price) -> | |
| meals ++ order menu (amount - price) (item : items)) [] menu |
This file contains hidden or 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
| ;; http://xkcd.com/287/ | |
| (defn order [menu amount items] | |
| (cond | |
| (< amount 0) [] | |
| (= amount 0) [items] | |
| :else (reduce | |
| (fn [meals, [item price]] | |
| (concat meals (order menu (- amount price) (into [item] items)))) [] menu))) |
This file contains hidden or 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
| # http://xkcd.com/287/ | |
| def order(menu, amount, items) | |
| return [] if amount < 0 | |
| return [items] if amount == 0 | |
| menu.inject([]) do |meals, (item, price)| | |
| meals += order(menu, amount - price, items + [item]) | |
| end | |
| end |
This file contains hidden or 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
| I18n.backend.store_translations :en, :thanks => 'Thanks %{name}!' | |
| I18n.translate :thanks, :name => 'Jeremy' | |
| # => 'Thanks Jeremy!' | |
| I18n.t :missing, :default => 'Not here' | |
| # => 'Not here' | |
| # config/locales/en.yml | |
| en: | |
| welcome: <b>welcome!</b> |
This file contains hidden or 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
| if (self.name.split.size < 2) | |
| self.errors.add :name, "must have first and last name" | |
| end |
This file contains hidden or 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
| body:lang(en) { | |
| font-size: 62.5%; | |
| font-family: en; | |
| } | |
| body:lang(zh-cn) { | |
| font-family: zh-cn; | |
| } | |
| @font-face { |