Skip to content

Instantly share code, notes, and snippets.

View deontologician's full-sized avatar
🦀
🌎

Josh Kuhn deontologician

🦀
🌎
View GitHub Profile
@deontologician
deontologician / gist:1378914
Created November 19, 2011 14:53
Enumerate example
my_list = ['a','b','c']
for index, value in enumerate(my_list):
print index, value
# This will print:
# 0 a
# 1 b
# 2 c
@deontologician
deontologician / gist:1285974
Created October 14, 2011 00:58
Closure example
function hailIfCargoMatches(lookingFor, specialHail)
function closure(event, data)
local cargoname,_,_ = unpack(data)
if cargoname:find(lookingFor, 1, true) then
sendChat(specialHail,"PRIVATE",currentTarget)
end
end
return closure
end
@deontologician
deontologician / gtklpbuild.txt
Created June 6, 2011 22:04
Failed compilation of gtklp
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
@deontologician
deontologician / PKGBUILD
Created May 3, 2011 04:47
PKGBUILD for mathpartir tex library
pkgname=mathpartir
pkgver=1.2
pkgrel=2
pkgdesc="Latex package for typesetting type inference rules"
arch=(any)
url="http://cristal.inria.fr/~remy/latex/"
license=('GPL')
install=install
source=('http://cristal.inria.fr/~remy/latex/mathpartir.dvi'
'http://cristal.inria.fr/~remy/latex/mathpartir.sty'
habitue@chompy ~/b/libtasn1 $ makepkg PKGBUILD
==> Making package: lib32-libtasn1 2.8-2 (Fri Mar 11 02:14:09 EST 2011)
==> Checking Runtime Dependencies...
==> Checking Buildtime Dependencies...
==> Retrieving Sources...
-> Downloading libtasn1-2.8.tar.gz...
--2011-03-11 02:14:09-- ftp://ftp.gnu.org/gnu/libtasn1/libtasn1-2.8.tar.gz
=> “libtasn1-2.8.tar.gz.part”
Resolving ftp.gnu.org... 140.186.70.20
Connecting to ftp.gnu.org|140.186.70.20|:21... connected.
import turtle as T
from random import randint
def spiral(linefun, incr=4, angle=30, iterations = 30):
for i in xrange(0,iterations):
linefun(i*incr)
T.left(angle)
def regular_line(length):
T.forward(length)
--
-- xmonad example config file.
--
-- A template showing all available configuration hooks,
-- and how to override the defaults in your own xmonad.hs conf file.
--
-- Normally, you'd only override those defaults you care about.
--
import XMonad
for file in ./bad*; do ./dj-lex ${file} > /dev/null; if ["$?" != "0"]; then echo "lex error on ${file}"; fi; done
---
- Card:
name: Lumber Mill
type: Structure
cost: free
abilities:
- Produce: (L)
defense: 4
unit_slots: 1
- Card:
{-# OPTIONS_GHC -fglasgow-exts #-}
module System.Console.CommandLine where
import System.Console.Haskeline
import Control.Monad.Trans (lift, MonadTrans)
import Control.Monad.State
import Control.Applicative
import qualified Data.Map as Map