Skip to content

Instantly share code, notes, and snippets.

@kjcolley7
kjcolley7 / README.md
Last active November 17, 2015 05:22
Safer way to free an allocation in C

There are two headers in this gist which both define the destroy() macro with the same behavior but in slightly different ways.

##destroy.h##

This version of the destroy() macro works with any compiler that supports __typeof__, which includes gcc and clang but unfortunately not MSVC. This version is completely type safe, because no casts are used and therefore the compiler can check that all types are convertible.

@kjcolley7
kjcolley7 / ExtraChessTests.hs
Created February 11, 2016 00:02
Extra test cases for COP 4020 Assignment 1
module ExtraChessTests where
import Chess
import Testing
extra_pos_tests =
-- Test legal positions
assertTrue (isLegalPosition ('h', 4))
+> assertTrue (isLegalPosition ('a', 1))
+> assertTrue (isLegalPosition ('h', 8))
@kjcolley7
kjcolley7 / keybase.md
Created March 9, 2017 08:04
Keybase proof

Keybase proof

I hereby claim:

  • I am kjcolley7 on github.
  • I am kjcolley7 (https://keybase.io/kjcolley7) on keybase.
  • I have a public key ASD91aTRhRKgUwWxRzQ8lkB39AyV3zHd15uEQCkfGVnB9Qo

To claim this, I am signing this object: