Skip to content

Instantly share code, notes, and snippets.

Avatar

Nels Nelson nelsnelson

View GitHub Profile
@nelsnelson
nelsnelson / latency.markdown
Created Oct 25, 2012 — forked from hellerbarde/latency.markdown
Latency numbers every programmer should know
View latency.markdown

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Syscall on Intel 5150 ...................... 105 ns
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Context switch on Intel 5150 ............. 4,300 ns  =   4 µs

Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs

@nelsnelson
nelsnelson / lxc-minimal.sh
Created Mar 17, 2014
Template for LXC intended to provide a minimal rootfs and ran as a daemon
View lxc-minimal.sh
#!/bin/bash
#
# lxc: linux Container library
# Authors:
# Daniel Lezcano <daniel.lezcano@free.fr>
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
View solarized.css
body { background: #002b36; color: #839496; }
a { color: #90939b; }
a:link, a:visited { color: #90939b; }
a:hover, a:active, a:focus { color: #90939b; }
hr { border-bottom: 1px solid #454c5c; border-top: 1px solid #002b36; }
@nelsnelson
nelsnelson / solarized-dark.css
Last active Apr 22, 2019
solarized-dark.css
View solarized-dark.css
/* @-moz-document regexp("https://[^./]*\\.slack\\.com/(?!pricing)(?!security).*") { body { background: #002b36; color: #a1adad; } */
body { background: #002b36; color: #a1adad; }
a { color: #268bd2; }
a:link, a:visited { color: #268bd2; }
a:hover, a:active, a:focus { color: #dc322f; }
hr { border-bottom: 1px solid #002b36; border-top: 1px solid #002b36; }
h1, h2, h3, h4 { color: #a1adad; }
h1 a { color: #a1adad; }
h1 a:active, h1 a:hover, h1 a:link, h1 a:visited { color: #a1adad; }
.bordered { border: 1px solid #00232c; }
View _solarized-dark.scss
// Solarized color palette
// Taken from ethanschoonover.com/solarized
$base03: #002b36;
$base02: #073642;
$base01: #586e75;
$base00: #657b83;
$base0: #839496;
$base1: #93a1a1;
$base2: #eee8d5;
$base3: #fdf6e3;
@nelsnelson
nelsnelson / support_chat_transcript.txt
Created Nov 29, 2018
Google Fi cell phone plan privacy
View support_chat_transcript.txt
Stephen
9:40 AM
Thanks for contacting Google Support. My name is Stephen.
Stephen
9:40 AM
Hi Nels!
Stephen
9:40 AM
How may we help you today?
Nels Nelson
@nelsnelson
nelsnelson / sblack_night_mode.css
Last active Jun 29, 2018
sblack_night_mode.css
View sblack_night_mode.css
html {
background: #222 !important;
}
body {
background: #222 !important;
color: #e6e6e6;
}
a {
color: #949494;
}
@nelsnelson
nelsnelson / faviconized-bookmarks.css
Created Feb 2, 2018
Bookmarks displayed on toolbars appear as favicons
View faviconized-bookmarks.css
/*
* When bookmarks are displayed on a toolbar, they appear as favicons. (Text is hidden)
*
* Screenshot: https://s26.postimg.org/lnb9akmbd/Faviconized-bookmarks.png
*
* Tested on Firefox 55, Windows 7
* Contributor(s): Okamoi
*/
/* Hides bookmark text for all bookmarks displayed in a toolbar */
@nelsnelson
nelsnelson / image-upload-glance.py
Last active Oct 18, 2017
Example of how to use python 3.6 requests to register/upload/create an image through an Openstack Glance API
View image-upload-glance.py
#! /usr/bin/env python3.6
import json
import os
import requests
import urllib
import sys
region = 'DFW'