Skip to content

Instantly share code, notes, and snippets.

View theunixman's full-sized avatar

Evan Cofsky theunixman

View GitHub Profile
@sehe
sehe / Makefile
Last active January 16, 2023 08:29
Boost shared memory lockfree circular buffer queue
all:consumer producer
CPPFLAGS+=-std=c++03 -Wall -pedantic
CPPFLAGS+=-g -O0
CPPFLAGS+=-isystem ~/custom/boost/
LDFLAGS+=-L ~/custom/boost/stage/lib/ -Wl,-rpath,/home/sehe/custom/boost/stage/lib
LDFLAGS+=-lboost_system -lrt -lpthread
%:%.cpp
@justinwoo
justinwoo / extract-fieldnames.purs
Last active April 22, 2018 15:02
extract field names from rows using rowtolist
module Main where
import Prelude
import Control.Monad.Eff (Eff)
import Control.Monad.Eff.Console (CONSOLE, logShow)
import Data.Symbol (class IsSymbol, SProxy(..), reflectSymbol)
import Type.Proxy (Proxy(..))
import Type.Row (class ListToRow, class RowToList, Cons, Nil, kind RowList)
@imaami
imaami / metamap.c
Last active July 24, 2023 00:40
Type information-encoded flags in C
#include <stdio.h>
enum {
FOO = 1 << 0,
BAR = 1 << 1,
BYX = 1 << 2,
QUE = 1 << 3
};
#define maybe_signed(T, cond) __typeof__( \