Skip to content

Instantly share code, notes, and snippets.

View jdoig's full-sized avatar

James Doig jdoig

  • Addepar
  • Edinburgh
View GitHub Profile
@jdoig
jdoig / Tools.fs
Created July 29, 2011 07:08
Tools for the first pass of my pathfinding
module Tools
open System
let sqr x = float(x * x) (* Square two ints into a float *)
(* Remove element where predicate *)
let rec remove l predicate =
match l with
| [] -> []
| hd::tl -> if predicate(hd) then
@jdoig
jdoig / sdl_demo.fs
Created July 28, 2011 23:27
sdl demo using F#
#light
open SdlDotNet.Core;
open SdlDotNet.Graphics;
open SdlDotNet.Graphics.Sprites;
open SdlDotNet.Input;
open System.Drawing;
open System;
type StuperGario = class
val mutable location : Point
@jdoig
jdoig / routes.clj
Created July 28, 2011 10:30
Very simple scooter hire example
(ns webapp.routes
(:use compojure.core
hiccup.core)
(:require [clj-http.client :as client]
[compojure.route :as route]
[clj-json.core :as json]))
;Make everything £40 for simplicity
(defn calculate-price [vehicle]
(assoc vehicle :price-per-day 40))