Skip to content

Instantly share code, notes, and snippets.

@gregberns
gregberns / Gists.md
Created March 10, 2021 16:47 — forked from BoQsc/Gists.md
How to search my own Gists

Stevey's Google Platforms Rant

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

@gregberns
gregberns / setup.sh
Last active November 12, 2021 05:53 — forked from bradp/setup.sh
New Mac Setup Script
# curl ~~Get gist raw url~~ > setup.sh
# chmod +x ~/setup.sh
# ~/setup.sh
GIT_USERNAME=________
GIT_EMAIL=________
GITHUB_ACCOUNT_NAME=________
MAC_USERNAME=________
MAC_MACHINE_NAME=________
@gregberns
gregberns / latency.txt
Created October 12, 2019 03:22 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
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 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
using System;
using System.Linq;
using System.Collections.Generic;
namespace DearCSharpYouLose {
public static class FuncExtension {
public static Func<A, C> Select<A, B, C>(this Func<A, B> f, Func<B, C> g) {
return a => g(f(a));
}
/*output is a concatenated string for testing, but feel free to reformat as needed*/
/*campaignID:experimentId:variationId:audienceId:"audience conditions"*/
/*e.g. 7807482864:7807902575:7806347946:6536242902:"and,or,or,{"value":"iphone","type":"device","name":null,"match":null}",7807482864:7807902575:7806347946:9436482444:"and,or,or,{"value":"00:00_23:59_friday","type":"time_and_day","name":null,"match":null}"*/
/*this code only includes audiences for which the visitor actually qualified*/
var state = window.optimizely.get && window.optimizely.get('state');
var data = window.optimizely.get && window.optimizely.get('data');
(function getCurrentActiveAll(e) {
if ('undefined' !== typeof window.optimizely) {