Skip to content

Instantly share code, notes, and snippets.

View kierdavis's full-sized avatar

Kier Davis kierdavis

View GitHub Profile
Prelude> mapM_ print [let h = 10^^(negate i) in (e**h - 1)/h | i <- [1..11]]
1.0517091807564771
1.005016708416795
1.0005001667083846
1.000050001667141
1.000005000006965
1.0000004999621837
1.0000000494336803
0.999999993922529
1.000000082740371
@kierdavis
kierdavis / keybase.md
Created April 21, 2014 21:08
Verification of my Keybase identity

Keybase proof

I hereby claim:

  • I am kierdavis on github.
  • I am kierdavis (https://keybase.io/kierdavis) on keybase.
  • I have a public key whose fingerprint is 69CB 931A 0A73 A3A2 3FB2 7B7F 6DA4 DA6B 003D 9C5A

To claim this, I am signing this object:

@kierdavis
kierdavis / PKGBUILD
Last active August 29, 2015 14:15
logisim-evolution 2.13.6 PKGBUILD
# Maintainer: Marcel Korpel <marcel[dot]korpel[at]gmail>
# Contributor: Renan Birck <renan.ee.ufsm at gmail.com>
pkgname=logisim-evolution
_truepkgname=logisim
pkgver=2.13.6
pkgrel=1
provides=('logisim')
conflicts=('logisim')
pkgdesc='An educational tool for designing and simulating digital logic circuits'
@kierdavis
kierdavis / gist:1034725
Created June 19, 2011 20:42
Simple Brainf*ck Single-Digit Adder
++++++++++[>++++++>+++<<-]>++...>++.[-]<[-]<,>++++++[<-------->-]++++++++++[>+>++++++>+++<<<-]>.>++...>++.[-]<[-]<[-]<,>++++++[<-------->-]<[<+>-]++++++++++[>+>++++++++>+++++++++++>++++++++++>+++>++++++<<<<<<-]>.>++++.>+.+++++.>---.<--------.>>++.<++++++++.++++++++++.>>--.<.>[-]<[-]<[-]<[-]<[-]<[-]<++++++[<++++++++>-]<.
@kierdavis
kierdavis / DCPU-16.v
Created April 19, 2012 17:42
DCPU-16 implementation in Verilog
/*
General state machine operation:
ST_FETCH - Load instruction word
ST_LOADAREF - Decode operand_a into a_type and a_value components
ST_LOADA - Load a using a_type and a_value
ST_LOADB - Decode operand_b and load b
ST_DECODE - Distribute to ST_opcode
ST_opcode - Modify b, using a
ST_STORE - Store b into a's location using a_type and a_value
*/
@kierdavis
kierdavis / me-with-templates.squirtle
Created July 10, 2012 22:17
Prototype of template
template OnlineAccount(?label, ?accountName, ?accountServiceHomepage, ?accountProfilePage) is {
a foaf:OnlineAccount
rdfs:label ?label
foaf:accountName ?accountName
foaf:accountServiceHomepage ?accountServiceHomepage
foaf:isPrimaryTopicOf ?accountProfilePage
}
me { a foaf:Person
foaf:account OnlineAccount("My del.icio.us account", "kierdavis",
@kierdavis
kierdavis / me.squirtle
Created July 10, 2012 22:03
Squirtle syntax example
name <http://kierdavis.com/data/me> as me
name <http://kierdavis.com/data/projects> as projects
me { a foaf:Person
foaf:name "Kier Davis"
foaf:nick "kier", "kierdavis"
foaf:homepage <http://kierdavis.com/>
foaf:age 15
foaf:birthday "02-15"
foaf:mbox <mailto:kierdavis@gmail.com>
@kierdavis
kierdavis / kier-and-jacobs-game.txt
Created July 20, 2012 23:04
Sketchpad for some Roguelike game
ASCII grid based (but not necessarily restricted to the command-line)
Steampunk/industrial theme
Base library: SDL (https://github.com/banthar/Go-SDL)
Available colours:
These are the 16 standard colours available to the command line (termbox, ANSI escapes etc).
"Proper" (but more complex) libraries like SDL can use more colours but we want to restrict it
to these to keep it simple and retro.
@kierdavis
kierdavis / roguelike.go
Created July 20, 2012 23:08
Paste of my original Roguelike code
package main
import (
"fmt"
"github.com/kierdavis/goutil"
"github.com/nsf/termbox-go"
"math/rand"
"os"
"time"
)
@kierdavis
kierdavis / nq2nt.sh
Created July 30, 2012 00:04
Sed command to remove context URIs from n-quads to make it n-triples
sed 's|<[^>]*> \.$|.|' input.nq > output.nt