Skip to content

Instantly share code, notes, and snippets.

View clickclickmoon's full-sized avatar

Andy Brown clickclickmoon

View GitHub Profile
@clickclickmoon
clickclickmoon / beer.crisp
Created May 22, 2011 21:06
99 bottles of beer on the wall in crisp
song[
[ This is the '99 bottles of beer on the wall' little puzzle from Rosetta Code.
The expected output is in (you'll never guess) expected.output for running
this program as a unit test.
comment]
exported[sing/0 list]
author[Andy Brown (click) <click.click.moon@gmail.com> string]
@clickclickmoon
clickclickmoon / Cakefile
Created May 5, 2011 04:57
Demo for the sp0t
fs = require('fs')
sys = require('sys')
exec = require('child_process').exec
spawn = require('child_process').spawn
option '-l', '--lint', 'Run the coffee scripts through jslint after compilation to javascript'
tar_cmd = "tar -cvjf ggnome.tar.bz2 server/"
###
@clickclickmoon
clickclickmoon / Cakefile
Created May 1, 2011 14:26
My First Cakefile
fs = require('fs')
sys = require('sys')
exec = require('child_process').exec
spawn = require('child_process').spawn
option '-l', '--lint', 'Run the coffee scripts through jslint after compilation to javascript'
###
Script File Data
#!/usr/bin/racc
# -*- encoding: utf-8 -*- Lapis Racc Parser Class
# Andy Brown <neorab@gmail.com> [April, 12, 2010]
/* This is a BNF style parser generator grammar for the
* Lapis Language to be used by racc. Racc is a tool
* much like Yacc or Bison implemented for Ruby.
*
* Racc will parse this file and create a lapis.tab.rb
* file that contains a Parser class with a do_parse
### network.rb - Andy Brown <neorab@gmail.com> [21 March, 2010]
###============================================================================
### Network class for communication with the game server.
require 'socket'
require 'fiber'
## Network Class
##-----------------------------------------------------------------------
## Rather than threads, the Network class uses fibers from Ruby 1.9. It
%% connection/1
%%==============================================================================
%% There are two common idioms I've found for this. (A) This function spawns a
%% handler loop and then recuses on itself. (B) This function spawns another of
%% itself and calls the handler loop. (A) makes more sense for the socket close
%% handling to be sure that it's getting done.
connection(Listen, ClientListPid) ->
% Accept a connection and set it up for incoming connections
{ok, Socket} = gen_tcp:accept(Listen),
12> c(s3d).
{ok,s3d}
13> s3d:unpack("qeynos2.s3d").
10dirt2b.bmp
10dirt3b.bmp
10dirtb.bmp
11gold.bmp
11prist3.bmp
11prist4.bmp
11side1.bmp