save_and_open_page
have_button(locator)
function rails_pg() { | |
rails new $1 -T --database=postgresql && | |
cd $1 && | |
echo $1 > .ruby-gemset && | |
echo 2.0 > .ruby-version && | |
echo /config/database.yml >> .gitignore && | |
cp config/database.yml config/database.example.yml && | |
add_rails_gems && |
function rails_pg() { | |
rails new $1 -T --database=postgresql && | |
cd $1 && | |
echo $1 > .ruby-gemset && | |
echo 2.0 > .ruby-version && | |
echo /config/database.yml >> .gitignore && | |
cp config/database.yml config/database.example.yml && | |
add_rails_gems && |
// utils/computed/search.js | |
import Ember from 'ember'; | |
var computed = Ember.computed; | |
export default function search(dependentKey, propertyKey, searchQueryKey, returnEmptyArray) { | |
returnEmptyArray = (typeof returnEmptyArray === "undefined") ? false : returnEmptyArray; | |
return computed("" + dependentKey + ".@each." + propertyKey, searchQueryKey, function() { | |
var items, query; | |
if (returnEmptyArray && !this.get(searchQueryKey)) { | |
return Ember.A([]); |
getTreeData: function() { | |
var rootNotebooks = this.get('rootNodes'); | |
var data = []; | |
rootNotebooks.forEach(function(notebook) { | |
var currentNotebook = notebook; | |
var dataObj = Ember.Object.create({ | |
'text': currentNotebook.get('title'), | |
'state' : {'opened' : false, 'selected' : false }, | |
'children': [] | |
}); |
big_hash = { | |
:random_key => [ | |
1, 2, "three", { | |
:foo => "bar", | |
:bar => "foo" | |
} | |
], | |
:another_key => 2, | |
:yet_another => { | |
:lorem => { |
Latency Comparison Numbers | |
-------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns | |
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms | |
Read 4K randomly from SSD* 150,000 ns 0.15 ms |
def move(num_disks, start, mid, last) | |
if num_disks == 1 | |
@towers[last] << @towers[start].pop | |
puts "Move disks from #{start} to #{last} : #{@towers}" | |
else | |
move(num_disks-1, start, last, mid) | |
move(1, start, mid, last) | |
move(num_disks-1, mid, start, last) | |
end | |
end |
A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."
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