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
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
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
__module_name__ = "isbanned" | |
__module_author__ = "mniip" | |
__module_version__ = "0.6" | |
__module_description__ = "freenode-specific module that checks whether someone is banned on some channel" | |
""" | |
Commands: | |
/isbanned <channel> <user> | |
Check whether <user> is banned on <channel> | |
/ismuted <channel> <user> |
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
#include <stdlib.h> | |
#include <unistd.h> | |
#include <time.h> | |
#include <string.h> | |
#include <signal.h> | |
#include <curses.h> | |
void quit() | |
{ | |
endwin(); |
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/sh | |
print_cell() | |
{ | |
if [ "$1" = 0 ]; then | |
echo -en " " | |
else | |
if [ "$1" -ge 128 ]; then | |
echo -en '\x1B[33m' | |
elif [ "$1" -ge 16 ]; then | |
echo -en '\x1B[31m' |
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 <stdlib.h> | |
#include <unistd.h> | |
#include <string.h> | |
#include <stdio.h> | |
#include <stdint.h> | |
#include <stddef.h> | |
#include <signal.h> | |
#include <limits.h> | |
#include <errno.h> | |
#include <pthread.h> |