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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#include <string.h> | |
#include <errno.h> | |
#include <unistd.h> | |
#include <fcntl.h> | |
#include <sys/ioctl.h> | |
#include <linux/hidraw.h> |
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
type MLens m s t a b = forall f. Traversable f => (a -> Compose m f b) -> s -> Compose m f t | |
mlens :: Monad m => (s -> m a) -> (s -> b -> m t) -> MLens m s t a b | |
mlens get set h s = Compose $ get s >>= getCompose . h >>= traverse (set s) | |
type MGetting m r s a = (a -> Compose m (Const r) a) -> s -> Compose m (Const r) s | |
mview :: Applicative m => MGetting m a s a -> s -> m a | |
mview l s = fmap getConst . getCompose $ l (\a -> Compose (pure (Const a))) 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
{-# OPTIONS_GHC -fno-warn-tabs -Wno-missing-fields #-} | |
import Control.Applicative | |
import Control.Monad | |
import Control.Monad.Yoctoparsec | |
import Data.Char | |
import Data.List | |
import qualified Data.Map as M | |
import Data.Maybe | |
import qualified Data.Set as S | |
import System.Environment |
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
CC= gcc | |
CFLAGS= -g | |
CPPFLAGS= | |
LINKFLAGS= | |
SOURCE=resizexfs.c | |
EXE=resizexfs | |
all: $(EXE) |
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
typedef struct { int ix; char const *str; } entry; | |
entry list_class[] = { | |
{ELFCLASSNONE, "ELFCLASSNONE"}, | |
{ELFCLASS32, "ELFCLASS32"}, | |
{ELFCLASS64, "ELFCLASS64"}, | |
{0, 0} | |
}; | |
entry list_data[] = { |
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 TypeOperators, KindSignatures, DataKinds, PolyKinds, GADTs, RankNTypes, StandaloneDeriving, InstanceSigs, ScopedTypeVariables #-} | |
module GHC.TypeLits.Singletons | |
( | |
NatSingleton(..), | |
NatIsZero(..), induceIsZero, | |
NatUnary(..), induceUnary, | |
NatTwosComp(..), induceTwosComp, | |
NatBaseComp(..), induceBaseComp, | |
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
local function pretty_print(term) | |
local introduced = {} | |
local total = {} | |
local function mark(seen, obj, from) | |
if seen[obj] then | |
introduced[obj] = from | |
else | |
seen[obj] = true | |
end | |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <signal.h> | |
#include <sys/mman.h> | |
#include <sys/user.h> | |
#include <sys/ptrace.h> |
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
#include <stdint.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <fcntl.h> | |
#include <sys/mman.h> | |
char var_1; | |
char var_2; | |
asm ( |
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
1{ | |
x | |
s/$/000000000/ | |
x | |
} | |
x | |
H | |
s/./&,/g | |
s/0//g | |
s/1/x/g |