Skip to content

Instantly share code, notes, and snippets.

├── Hydrogen@1.17.0
├── Sublime-Style-Column-Selection@1.7.4
├── activate-power-mode@2.0.0
├── aligner@1.2.2
├── aligner-javascript@1.1.0
├── atom-beautify@0.29.26
├── atom-material-syntax-dark@1.0.0
├── atom-material-syntax-light@0.4.6
├── atom-material-ui@2.0.4
├── atom-monokai@0.10.9
@tyler-reitz
tyler-reitz / latency.txt
Created March 26, 2017 21:12 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
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 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
@tyler-reitz
tyler-reitz / latency.txt
Created March 26, 2017 21:12 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
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 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
@tyler-reitz
tyler-reitz / array_iteration_thoughts.md
Created January 22, 2017 12:54 — forked from ljharb/array_iteration_thoughts.md
Array iteration methods summarized

While attempting to explain JavaScript's reduce method on arrays, conceptually, I came up with the following - hopefully it's helpful; happy to tweak it if anyone has suggestions.

Intro

JavaScript Arrays have lots of built in methods on their prototype. Some of them mutate - ie, they change the underlying array in-place. Luckily, most of them do not - they instead return an entirely distinct array. Since arrays are conceptually a contiguous list of items, it helps code clarity and maintainability a lot to be able to operate on them in a "functional" way. (I'll also insist on referring to an array as a "list" - although in some languages, List is a native data type, in JS and this post, I'm referring to the concept. Everywhere I use the word "list" you can assume I'm talking about a JS Array) This means, to perform a single operation on the list as a whole ("atomically"), and to return a new list - thus making it much simpler to think about both the old list and the new one, what they contain, and

# Javascript Fundamentals
<!--
Hey mentor,
I was working through an assignment last night and came across a bug. I'm so confused!
<button id="btn-0">Button 1!</button>
<button id="btn-1">Button 2!</button>