Skip to content

Instantly share code, notes, and snippets.

View cstrahan's full-sized avatar

Charles Strahan cstrahan

  • Fullstory
  • Dallas, TX
View GitHub Profile
@cstrahan
cstrahan / HRecursionSchemes.hs
Created November 26, 2018 05:30 — forked from xgrommx/HRecursionSchemes.hs
HRecursionSchemes
{-# LANGUAGE StandaloneDeriving, DataKinds, PolyKinds, GADTs, RankNTypes, TypeOperators, FlexibleContexts, TypeFamilies, KindSignatures #-}
-- http://www.timphilipwilliams.com/posts/2013-01-16-fixing-gadts.html
module HRecursionSchemes where
import Control.Applicative
import Data.Functor.Identity
import Data.Functor.Const
import Text.PrettyPrint.Leijen hiding ((<>))
@cstrahan
cstrahan / IxFix.hs
Created November 26, 2018 05:30 — forked from AndrasKovacs/IxFix.hs
Example for recursion schemes for mutually recursive data
{-# LANGUAGE
UndecidableInstances, RankNTypes, TypeOperators, TypeFamilies,
StandaloneDeriving, DataKinds, PolyKinds, DeriveFunctor, DeriveFoldable,
DeriveTraversable, LambdaCase, PatternSynonyms, TemplateHaskell #-}
import Control.Monad
import Control.Applicative
import Data.Singletons.TH
@cstrahan
cstrahan / setupYubikey.sh
Created August 29, 2018 00:59 — forked from rpardini/setupYubikey.sh
Automated-ish setup of Yubikey for SSH logins (replace ssh-agent with gpg-agent from brew)
#! /bin/bash
set -e
GPGCONF_PATH=$(which gpgconf)
if [[ "$GPGCONF_PATH" != "/usr/local/bin/gpgconf" ]]; then
echo "You don't have gnupg installed from brew, lets install it."
brew install gnupg pinentry-mac ykpers
else
@cstrahan
cstrahan / SMBDIS.ASM
Created October 16, 2017 22:51 — forked from 1wErt3r/SMBDIS.ASM
A Comprehensive Super Mario Bros. Disassembly
;SMBDIS.ASM - A COMPREHENSIVE SUPER MARIO BROS. DISASSEMBLY
;by doppelganger (doppelheathen@gmail.com)
;This file is provided for your own use as-is. It will require the character rom data
;and an iNES file header to get it to work.
;There are so many people I have to thank for this, that taking all the credit for
;myself would be an unforgivable act of arrogance. Without their help this would
;probably not be possible. So I thank all the peeps in the nesdev scene whose insight into
;the 6502 and the NES helped me learn how it works (you guys know who you are, there's no
@cstrahan
cstrahan / example.go
Created October 5, 2017 20:18 — forked from kavu/example.go
Minimal Golang + Cocoa application using CGO. Build with `CC=clang go build`
package main
/*
#cgo CFLAGS: -x objective-c
#cgo LDFLAGS: -framework Cocoa
#import <Cocoa/Cocoa.h>
int
StartApp(void) {
[NSAutoreleasePool new];
@cstrahan
cstrahan / example.go
Created October 5, 2017 20:18 — forked from kavu/example.go
Minimal Golang + Cocoa application using CGO. Build with `CC=clang go build`
package main
/*
#cgo CFLAGS: -x objective-c
#cgo LDFLAGS: -framework Cocoa
#import <Cocoa/Cocoa.h>
int
StartApp(void) {
[NSAutoreleasePool new];
@cstrahan
cstrahan / main.hs
Created October 2, 2017 07:31 — forked from cocreature/main.hs
{-# LANGUAGE MagicHash, UnboxedTuples #-}
module Main(main) where
import GHC.Exts ( addrToAny# )
import GHC.Ptr ( Ptr(..) )
import System.Info ( os, arch )
import Encoding
import ObjLink
main :: IO ()
@cstrahan
cstrahan / bridged.conf
Created August 3, 2017 02:47 — forked from gdamjan/bridged.conf
bridged openvpn with networkd
# /etc/openvpn/bridged.conf
comp-lzo
persist-key
persist-tun
dh /etc/openvpn/dh1024.pem
ca /etc/openvpn/ca.crt
cert /etc/openvpn/bridged.crt
key /etc/openvpn/bridged.key
@cstrahan
cstrahan / Deriv.idr
Created July 20, 2017 07:14 — forked from paf31/Deriv.idr
Calculus of types in idris
module Deriv
import Control.Isomorphism
--
-- A type constructor df is the derivative of the type constructor f if for all x and e there exists d such
-- such that
--
-- f (x + e) ~ f x + e * (df x) + e^2 * d
--