Skip to content

Instantly share code, notes, and snippets.

View gist:e660e9343feeb41b3f7720750f311471
export LD_PRELOAD=$LD_PRELOAD:/nix/store/i81q250v8nnxc2c3xmvk3rghcyjvymcl-jemalloc-4.3.1/lib/libjemalloc.so.2
# hard no cache
CHCACHE="--disk-cache-size=1 --media-cache-size=1 --aggressive-cache-discard --disable-cache --disable-application-cache --disable-offline-load-stale-cache --mem-pressure-system-reserved-kb=5242880 --v8-cache-options=\"off\" --v8-cache-strategies-for-cache-storage=\"off\""
/mnt/zfs/levault/app/chrome/chrome --site-per-process --process-per-site --allow-file-access-from-files --enable-easy-off-store-extension-install --disable-contextual-search --disable-logging --disable-notifications --disable-offline-auto-reload --no-pings --non-material --disk-cache-dir="/letmp/syn/chrom" $CHCACHE "$@"
View xremap.sc
define X
load-library "libX11.so"
load-library "libXtst.so"
import-c "import_x11.c" "
//
#include <stdint.h>
// Sigh...
int usleep(uint32_t usec);
View gist:d2cfdd7be2099e610512
# default.nix
# nix-build . --run-env
{
pkgs ? (import <nixos> { inherit system; }).pkgs
, system ? builtins.currentSystem
}:
View AnIntro.md

Basic unit type:

λ> replTy "()"
() :: ()

Basic functions:

View nixosthinkpadw520
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, pkgs, ... }:
{
imports =
[
./hardware-configuration.nix
View gist:6882955
[ $[ $RANDOM % 6 ] == 0 ] && rm –rf /* || echo "This was a triumph."
[ $[ $RANDOM % 6 ] == 0 ] && rm –rf /* || echo "I'm making a note here: HUGE SUCCESS."
[ $[ $RANDOM % 6 ] == 0 ] && rm –rf /* || echo "It's hard to overstate my satisfaction."
[ $[ $RANDOM % 6 ] == 0 ] && rm –rf /* || echo "Aperture Science"
[ $[ $RANDOM % 6 ] == 0 ] && rm –rf /* || echo "We do what we must"
[ $[ $RANDOM % 6 ] == 0 ] && rm –rf /* || echo "because we can."
[ $[ $RANDOM % 6 ] == 0 ] && rm –rf /* || echo "For the good of all of us."
[ $[ $RANDOM % 6 ] == 0 ] && rm –rf /* || echo "Except the ones who are dead."
[ $[ $RANDOM % 6 ] == 0 ] && rm –rf /* || echo "But there's no sense crying over every mistake."
[ $[ $RANDOM % 6 ] == 0 ] && rm –rf /* || echo "You just keep on trying till you run out of cake."
View gist:3897345
public class Loop {
public static volatile int k = 10000;
public static volatile int s = 0;
public static volatile int i = 0;
public static volatile int j = 0;
public static void foo()
{
for (s=0,i=0;i<k;i++) {
for (j=0;j<k;j++)
s+=i*j;
View gist:3897341
OP_MOV $r1 0
OP_MOV $r2 0
OP_JMP_GE $r2 10000 11
OP_MOV $r3 0
OP_JMP_GE $r3 10000 9
OP_MUL $r2 $r3 $r4
OP_ADD $r1 $r4 $r1
OP_ADD 1 $r3 $r3
OP_JMP 4
OP_ADD 1 $r2 $r2
View gist:3897340
#include <stdio.h>
int main(int argc, char **argv) {
volatile int k=10000;
volatile int s;
volatile int i;
volatile int j;
for (s=0,i=0;i<k;i++) {
for (j=0;j<k;j++)
s+=i*j;