Skip to content

Instantly share code, notes, and snippets.

View prophile's full-sized avatar

Alistair Lynn prophile

View GitHub Profile
@prophile
prophile / DFRP.hs
Created July 11, 2013 05:21
A third rough sketch of an FRP system in Haskell.
{-# LANGUAGE GeneralizedNewtypeDeriving, MultiParamTypeClasses, FunctionalDependencies, FlexibleInstances, RankNTypes, MonadComprehensions, TupleSections #-}
import Control.Applicative
import Data.Monoid
import Control.Monad
import Control.Monad.Cont
import Control.Concurrent.MVar
import Data.IORef
newtype SignalIn m a = SignalIn (Cont (m ()) a)
#!/bin/sh
mkdir /tmp/robot-bee
cp -R $1 /tmp/robot-bee/robot.zip
pushd /tmp/robot-bee
unzip robot.zip
rm robot.zip
rm -rf user/.git
find user -name '*.pyc' | xargs rm
rm -rf user/.gitignore
rm -rf user/.gitattributes
for (var i = 0; i < obj["userids"].length; i++) {
(function(userid) {
$.get("user/" + userid, {"token":token}, function(resp, userid) {
var user_name = JSON.parse(resp)["full_name"];
build += "<li><a class='user' id='user-" + userid + "' href='#show-" + userid + "'>" + user_name + "</a></li>";
remaining -= 1;
if (remaining == 0) {
make_users_list(obj, build);
hide_spinner();
$("#login").hide();
#!/bin/bash
if [ -e $1 ]; then
rm -f $1
else
touch $1
fi
module std.kmp;
export kmp;
kmpl<a> :: Array<a> -> Array<a> -> Maybe<Int>;
kmp<a> :: Array<a>, Array<a> -> Maybe<Int>;
kmpAdvanceTable<a> :: Array<a> -> Array<Int>;
kmpl(pattern) {
@prophile
prophile / gist:887232
Created March 25, 2011 17:30
PonyLeaks reveals diplomatic cables
THINGS TO OCCUR
Thursday (small team of 2-3)
* If seating is out, retract seating
* Mark out layout in Cube & Bar 2
* DJ riser
* Power
* Network
* Verify facilities (projector etc)
module std;
export Maybe;
export Nothing;
export Just;
export force;
export isNothing;
Maybe<a> = variant Nothing, Just(a)
module std;
export Maybe;
export Nothing;
export Just;
export force;
export isNothing;
Maybe<a> = variant Nothing, Just(a)
module xtoa;
export xtoa;
export hexValue;
export decValue;
export binValue;
xtoa :: String, Int -> String;
hexValue :: Int -> String;