- Randomly mixes input gathering, error handling, and business logic
- imposes cognitive load on the reader
- no digressions
;variants of the code from point #2 of: | |
; http://www.tbray.org/ongoing/When/200x/2009/12/01/Clojure-Theses | |
;original | |
(apply merge-with + | |
(pmap count-lines | |
(partition-all *batch-size* | |
(line-seq (reader filename))))) |
I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.
I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real
class InputOutput | |
def initialize(&action) | |
@action = action | |
end | |
private_class_method :new | |
# return :: (Monad m) => a -> m a | |
def self.unit(x) | |
new { x } | |
end |
# Resize selenium browser window to avoid Selenium::WebDriver::Error::MoveTargetOutOfBoundsError errors | |
# | |
# Example usage with Rspec (in spec/support/spec_helper.rb): | |
# | |
# config.before(:each) do | |
# set_selenium_window_size(1250, 800) if Capybara.current_driver == :selenium | |
# end | |
# | |
def set_selenium_window_size(width, height) | |
window = Capybara.current_session.current_window.resize_to |
# Option defaults | |
OPT="value" | |
# getopts string | |
# This string needs to be updated with the single character options (e.g. -f) | |
opts="fvo:" | |
# Gets the command name without path | |
cmd(){ echo `basename $0`; } |
function UndoItem (perform, data) { | |
this.perform = perform; | |
this.data = data; | |
} | |
/** | |
* UndoStack: | |
* Easy undo-redo in JavaScript. | |
**/ |
#Ruby alternatives for parsing CSV files | |
# Ruby String#split (slow) | |
# Ruby CSV (slow) | |
# FasterCSV (ok, recommended) | |
# ccsv (fast & recommended if you have control over CSV format) | |
# CSVScan (fast & recommended if you have control over CSV format) | |
# Excelsior (fast & recommended if you have control over CSV format) | |
#CSV library benchmarks can be found here and here |
# initializers/savon.rb | |
# Savon Global configuration | |
Savon.configure do |config| | |
config.log = true | |
config.log_level = :debug | |
config.logger = Rails.logger | |
config.env_namespace = :soapenv | |
end |