Skip to content

Instantly share code, notes, and snippets.

View crdueck's full-sized avatar

Chris Dueck crdueck

View GitHub Profile
! URxvt settings
URxvt.scrollBar: off
!URxvt.font: xft:terminus:size=12:antialias=true
URxvt.intensityStyles: false
URxvt.letterSpace: -1
URxvt.perl-ext-common: default,matcher
URxvt.url-launcher: /usr/bin/firefox
URxvt.matcher.button: 1
! Common
@crdueck
crdueck / Cards.hs
Last active June 24, 2016 21:30
Dominion WIP
{-# LANGUAGE GADTs #-}
import Control.Lens
import Control.Monad.Free
data Action
= Cellar | Chapel | Moat
| Chancellor | Village | Woodcutter | Workshop
| Bureaucrat | Feast | Gardens | Militia | Moneylender | Remodel | Smithy | Spy | Thief | ThroneRoom
| CouncilRoom | Festival | Laboratory | Library | Market | Mine | Witch
@crdueck
crdueck / donut.py
Last active April 9, 2022 02:41
donut.py
#! /usr/bin/env python3
# Ported from http://www.a1k0n.net/2011/07/20/donut-math.html
# Run with 'python donut.py'
import math
R1 = 1
R2 = 2
K2 = 5
@crdueck
crdueck / dis.sh
Created September 24, 2016 02:24
dis
#!/bin/sh
function dis {
case "$1" in
--stash)
export DIS_STASH_FILE="$(mktemp)"
gdb -batch -ex "disassemble $3" $2 >> $DIS_STASH_FILE
cat $DIS_STASH_FILE
;;
@crdueck
crdueck / pacman-disowned
Created September 24, 2016 02:26
pacman-disowned
#!/bin/sh
tmp=${TMPDIR-/tmp}/pacman-disowned-$UID-$$
db=$tmp/db
fs=$tmp/fs
mkdir "$tmp"
trap 'rm -rf "$tmp"' EXIT
pacman -Qlq | sort -u > "$db"
@crdueck
crdueck / type-family-map.hs
Created December 6, 2020 00:41
Type family inference
{-# LANGUAGE GADTs, TypeFamilies, DataKinds, TypeOperators #-}
import Type.Reflection
type family Map f xs where
Map f '[] = '[]
Map f (x ': xs) = f x ': Map f xs
data HList xs where
HNil :: HList '[]