Skip to content

Instantly share code, notes, and snippets.

View bhpayne's full-sized avatar
💭
wandering in the wilderness

Ben bhpayne

💭
wandering in the wilderness
View GitHub Profile
@bhpayne
bhpayne / latency.txt
Created May 27, 2023 23:23 — 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
@bhpayne
bhpayne / scar_tissue.md
Created May 27, 2023 16:56 — forked from gtallen1187/scar_tissue.md
talk given by John Ousterhout about sustaining relationships

"Scar Tissues Make Relationships Wear Out"

04/26/2103. From a lecture by Professor John Ousterhout at Stanford, class CS142.

This is my most touchy-feely thought for the weekend. Here’s the basic idea: It’s really hard to build relationships that last for a long time. If you haven’t discovered this, you will discover this sooner or later. And it's hard both for personal relationships and for business relationships. And to me, it's pretty amazing that two people can stay married for 25 years without killing each other.

[Laughter]

> But honestly, most professional relationships don't last anywhere near that long. The best bands always seem to break up after 2 or 3 years. And business partnerships fall apart, and there's all these problems in these relationships that just don't last. So, why is that? Well, in my view, it’s relationships don't fail because there some single catastrophic event to destroy them, although often there is a single catastrophic event around the the end of the relation

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
@bhpayne
bhpayne / duck.sty
Created December 31, 2022 20:30 — forked from cereda/duck.sty
Sample duck package
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{duck}[2012/18/07 Duck style for memoir]
\RequirePackage{graphicx}
\RequirePackage{xcolor}
\RequirePackage{tikz}
\RequirePackage{xspace}
\definecolor{cffffff}{RGB}{255,255,255}
\definecolor{cffcc00}{RGB}{255,204,0}

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

@bhpayne
bhpayne / .block
Created June 4, 2020 11:59 — forked from XavierGimenez/.block
Grouping nodes in a Force-Directed Graph
license: gpl-3.0
height: 600
@bhpayne
bhpayne / index.html
Created May 25, 2020 23:01 — forked from d3noob/index.html
Range input with v4
<!DOCTYPE html>
<meta charset="utf-8">
<title>Input test (circle)</title>
<p>
<label for="nRadius"
style="display: inline-block; width: 240px; text-align: right">
radius = <span id="nRadius-value">…</span>
</label>
<input type="range" min="1" max="150" id="nRadius">
@bhpayne
bhpayne / .block
Created May 25, 2020 23:00 — forked from d3noob/.block
Multiple HTML inputs linked with d3.js
license: mit
@bhpayne
bhpayne / graph.json
Created May 15, 2020 14:41 — forked from JakeTTU/graph.json
Graph with Link Filtering
{
"nodes": [
{
"id": "Person1",
"group": "#000"
},
{
"id": "Person2",
"group": "#000"
},
@bhpayne
bhpayne / README.md
Created May 14, 2020 12:15 — forked from cjrd/README.md
Interactive tool for creating directed graphs using d3.js.

directed-graph-creator

Interactive tool for creating directed graphs, created using d3.js.

Demo: http://bl.ocks.org/cjrd/6863459

Operation:

  • drag/scroll to translate/zoom the graph