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([]); |
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 |
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
We Gophers, love table-driven-tests, it makes our unittesting structured, and makes it easy to add different test cases with ease.
Let’s create our table driven test, for convenience, I chose to use t.Log
as the test function.
Notice that we don't have any assertion in this test, it is not needed to for the demonstration.
func TestTLog(t *testing.T) {
t.Parallel()