Skip to content

Instantly share code, notes, and snippets.

@glowe
glowe / latency.txt
Created November 8, 2021 23:51 — 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

Principles of Adult Behavior

  1. Be patient. No matter what.
  2. Don’t badmouth: Assign responsibility, not blame. Say nothing of another you wouldn’t say to him.
  3. Never assume the motives of others are, to them, less noble than yours are to you.
  4. Expand your sense of the possible.
  5. Don’t trouble yourself with matters you truly cannot change.
  6. Expect no more of anyone than you can deliver yourself.
  7. Tolerate ambiguity.
  8. Laugh at yourself frequently.
@glowe
glowe / The Technical Interview Cheat Sheet.md
Last active August 25, 2015 19:39 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.

Keybase proof

I hereby claim:

  • I am glowe on github.
  • I am glowe (https://keybase.io/glowe) on keybase.
  • I have a public key whose fingerprint is C1AF 5373 C10F 89AA B15B E4A4 DFFE 5176 9583 5E82

To claim this, I am signing this object:

@glowe
glowe / gist:4195801
Created December 3, 2012 15:40
Send an email when a supervisord-managed process exits.
#!/usr/bin/env python
import datetime
import os
import smtplib
import supervisor.childutils
import sys
def send_email(sender, recipient, msg):