Skip to content

Instantly share code, notes, and snippets.

@michaelt
michaelt / benchcompose.hs
Last active June 13, 2016 20:18
benchmark prelude compositions following the pattern of john weigley's https://github.com/jwiegley/streaming-tests
{-#LANGUAGE BangPatterns #-}
module Main (main) where
import Data.Conduit as C
import qualified Data.Conduit.Combinators as C
import Pipes as P
import qualified Pipes.Prelude as P
import qualified Streaming.Prelude as Str
@ipbastola
ipbastola / clean-up-boot-partition-ubuntu.md
Last active August 16, 2024 13:39
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@eshelman
eshelman / latency.txt
Last active March 4, 2025 03:41 — forked from jboner/latency.txt
HPC-oriented Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference/hit 1.5 ns 4 cycles
Floating-point add/mult/FMA operation 1.5 ns 4 cycles
L2 cache reference/hit 5 ns 12 ~ 17 cycles
Branch mispredict 6 ns 15 ~ 20 cycles
L3 cache hit (unshared cache line) 16 ns 42 cycles
L3 cache hit (shared line in another core) 25 ns 65 cycles
Mutex lock/unlock 25 ns
L3 cache hit (modified in another core) 29 ns 75 cycles
@mchav
mchav / CubeActivity.fr
Created January 18, 2017 03:19
Touch rotating cube in Frege on Android. See froid instructions on how to run.
module io.github.mchav.touchcube.CubeActivity where
import froid.javax.microedition.khronos.egl.EGLConfig
import froid.javax.microedition.khronos.opengles.GL10
import froid.java.nio.ByteBuffer
import froid.java.nio.IntBuffer
import froid.app.Activity
import froid.content.Context
@yossorion
yossorion / what-i-wish-id-known-about-equity-before-joining-a-unicorn.md
Last active April 15, 2025 22:49
What I Wish I'd Known About Equity Before Joining A Unicorn

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

@manveru
manveru / configuration.nix
Last active July 26, 2020 23:41
Updating vim plugins for nix
{ pkgs }:
let plugins = pkgs.callPackage ./plugins.nix {};
in {
customRC = ''${builtins.readFile ./vimrc}'';
vam = {
knownPlugins = pkgs.vimPlugins // plugins;
pluginDictionaries = [{
names = [
"Tagbar"
"css-pretty"
{ pkgs }:
{
allowBroken = true;
allowUnfree = true;
packageOverrides = super: let self = super.pkgs; in with self; rec {
#### Global overrides.
--Roughly based on https://github.com/Gabriel439/Haskell-Morte-Library/blob/master/src/Morte/Core.hs by Gabriel Gonzalez et al.
data Expr = Star | Box | Var Int | Lam Int Expr Expr | Pi Int Expr Expr | App Expr Expr deriving (Show, Eq)
subst v e (Var v') | v == v' = e
subst v e (Lam v' ta b ) | v == v' = Lam v' (subst v e ta) b
subst v e (Lam v' ta b ) = Lam v' (subst v e ta) (subst v e b )
subst v e (Pi v' ta tb) | v == v' = Pi v' (subst v e ta) tb
subst v e (Pi v' ta tb) = Pi v' (subst v e ta) (subst v e tb)
subst v e (App f a ) = App (subst v e f ) (subst v e a )
@johnweldon
johnweldon / update_dynamic_dns
Created March 4, 2018 05:42
bash script to update dynamic dns ip address on google domains from a Zyxel C3000Z modem
#!/usr/bin/env bash
#
# Update Google Domains Dynamic DNS from Zyxel C3000Z modem information.
# Tested on a Centurylink issued modem, YMMV
#
# See https://support.google.com/domains/answer/6147083?hl=en for
# Google Domains help and credentials information
#
@dotspencer
dotspencer / google-wifi-setup-centurylink.md
Last active October 3, 2023 01:53
How to use Google WiFi with CenturyLink Internet (ZyXEL C3000Z, 80mbps, modem bridge)