Skip to content

Instantly share code, notes, and snippets.

jonhoo /
Last active Jul 19, 2021
Distributed RWMutex in Go
addyosmani /
Last active Jan 19, 2022 — forked from 140bytes/LICENSE.txt
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

mattdesl / gist:10218005
Created Apr 9, 2014
pseudo-code for perlin-noise based generative impressionist paintings
View gist:10218005
for each particle
x, y = particle.position
color = sample( colorMap, x, y )
noise = sample( noiseMap, x, y )
angle = noise * PI * 2
particle.velocity.add( cos(angle), sin(angle) )
pabigot /
Created Nov 19, 2013
C++11 template function to perform integer rotations without invoking undefined behavior. See
/* See
#include <type_traits>
#include <cstdint>
#include <limits>
#include <typeinfo>
#ifndef ARGTYPE
#define ARGTYPE uint32_t
#endif /* ARGTYPE */
wsargent /
Last active Nov 11, 2021
Docker cheat sheet
arnehormann / must.go
Created Sep 23, 2013
usage example for reflect.MakeFunc: create panic-on-error wrappers which do not pass the error (in a comfortable but probably rather slow way)
View must.go
import "reflect"
// assumption for fptr: func with error as last argument
func makeMust(fptr interface{}) {
must := func(in []reflect.Value) []reflect.Value {
if err := in[len(in)-1]; !err.IsNil() {
return in[:len(in)-1]
cuadue / cubism-websockets.html
Created Sep 3, 2013
Streaming data to cubism.js with websockets
View cubism-websockets.html
<!DOCTYPE html>
<meta charset='utf-8'>
<title>Cubism + Websockets</title>
<script language='javascript' src='d3.min.js'></script>
<script language='javascript' src='cubism.v1.js'></script>
<script language='javascript'>
/* I can never seem to remember:
Array.push() appends to the end, and returns the new length
# stop on errors and undeclared variables
set -e -u -o pipefail
err() {
echo "[$(date +'%Y-%m-%dT%H:%M:%S%z')]: $@" >&2
minikomi / persona.go
Last active Dec 11, 2015
mozilla persona test
View persona.go
package main
import (
View Three Wise

Date: [date]

Between us [company name] and you [customer name].


In short; neither of us will share any confidential information about each-other, by any means, with anyone else.

What’s confidential information?