This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Build using | |
* | |
* gcc -shared -o libcrc32.so -O2 crc32.c | |
* | |
* Then run using | |
* | |
* LD_PRELOAD=./libcrc32.so myprog | |
*/ | |
unsigned long crc32(unsigned long crc, const unsigned char *buf, unsigned int len) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[user] | |
[color] | |
ui = auto | |
diff = auto | |
status = auto | |
branch = auto | |
[alias] | |
ci = commit -s | |
pick = cherry-pick -s -x | |
graph = log --graph --pretty=oneline --abbrev-commit --all --decorate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DTRACE := dtrace | |
default: demo | |
sofs_probes.h: sofs_probes.d | |
$(DTRACE) -h -o $@ -s $< | |
sofs_probes.o: sofs_probes.d | |
$(DTRACE) -G -o $@ -s $< |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Deriving Typeclass Instances using Typed Holes | |
> module Conc where | |
> import Control.Applicative | |
We're presented with the following structure: | |
> data Concurrent a = Concurrent ((a -> Action) -> Action) | |
> data Action = Atom (IO Action) | |
> | Fork Action Action |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- JSON = (loadfile "JSON.lua")() | |
-- Utilities | |
function randomString(len) | |
local tab = {} | |
for i = 1, len do | |
tab[i] = string.char(math.random(0, 255)) | |
end | |
return table.concat(tab) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/stack.sh b/stack.sh | |
index ec13338..612cf73 100755 | |
--- a/stack.sh | |
+++ b/stack.sh | |
@@ -388,6 +388,7 @@ if [[ -n "$LOGFILE" ]]; then | |
# Set fd 3 to a copy of stdout. So we can set fd 1 without losing | |
# stdout later. | |
exec 3>&1 | |
+ exec 4>&2 | |
if [[ "$VERBOSE" == "True" ]]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def mkdir_nicolast2(path, fsync=False): | |
'''Recursively create a directory | |
If `fsync` is `True`, parent directories of created directories are | |
`fsync`ed. | |
''' | |
abspath = os.path.abspath(path) | |
# Step 1: Calculate which directories need to be created (in reverse order) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -ue | |
MODULE=$1 | |
SYMBOL_PATH_BASE=usr/lib/debug | |
SYS_MODULES_BASE=/sys/module | |
MODULES_BASE=/lib/modules/`uname -r`/ | |
function go() { | |
MODULE_NAME=$1 | |
SECTIONS_PATH=$SYS_MODULES_BASE/`echo $MODULE_NAME | sed s/-/_/g`/sections |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE KindSignatures #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE TypeOperators #-} | |
{-# LANGUAGE PolyKinds #-} | |
{-# LANGUAGE UndecidableInstances #-} | |
{-# LANGUAGE ConstraintKinds #-} | |
module Main where |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE Rank2Types #-} | |
{-# LANGUAGE DeriveGeneric #-} | |
{-# LANGUAGE TypeOperators #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE DefaultSignatures #-} | |
{-# LANGUAGE DeriveDataTypeable #-} | |
{-# LANGUAGE StandaloneDeriving #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
module Main where |