View in Full Page for best experience
Illustrations by Icons 8 from Ouch!
View in Full Page for best experience
Illustrations by Icons 8 from Ouch!
GRUB_INIT_TUNE="1000 334 1 334 1 0 1 334 1 0 1 261 1 334 1 0 1 392 2 0 4 196 2"
# Customize BASH PS1 prompt to show current GIT repository and branch. | |
# by Mike Stewart - http://MediaDoneRight.com | |
# SETUP CONSTANTS | |
# Bunch-o-predefined colors. Makes reading code easier than escape sequences. | |
# I don't remember where I found this. o_O | |
# Reset | |
Color_Off="\[\033[0m\]" # Text Reset |
type PickProp<T, K> = K extends keyof NonNullable<T> | |
? T extends undefined | |
? NonNullable<T>[K] | undefined | |
: NonNullable<T>[K] | |
: undefined; | |
export function focusPropAtom<Store, Result, Key extends keyof NonNullable<Store>>( | |
baseAtom: WritableAtom<Store, [SetStateAction<Store>], Result>, | |
path: Key, | |
) { |
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 |
function obj2str(obj) { | |
var fString = function(objj) { | |
if (!objj) return objj; | |
var newObj = Array.isArray(objj) ? [] : {} | |
Object.keys(objj).map(function(k) { | |
if (typeof(objj[k]) == "function") newObj[k] = objj[k].toString(); | |
else if (typeof(objj[k]) == "object") newObj[k] = fString(objj[k]); | |
else newObj[k] = objj[k]; | |
}) | |
return newObj; |
/* | |
* Stripe WebGl Gradient Animation by Stripe.com | |
* ScrollObserver functionality to disable animation when not scrolled into view has been disabled and | |
* commented out for now. | |
* | |
* Taken from: https://kevinhufnagl.com/how-to-stripe-website-gradient-effect/ | |
* See also: https://codepen.io/smitpatelx/pen/GRZayyO | |
*/ | |
// Converting colors to proper format |
// Based on Dean McNamee's OBJ loader | |
// Modified to output triangles with texture coords | |
function loadOBJ(filename){ | |
var filedata = fs.readFileSync(filename, 'utf8'); | |
var lines = filedata.split('\n'); | |
var tris = [ ]; | |
var v = [ null, ]; // Verts, indexed from 1, so put in a filler. |