Skip to content

Instantly share code, notes, and snippets.

@JulianBirch
JulianBirch / lein.ps1
Created May 9, 2010 09:06 — forked from rosado/lein.ps1
Lein.ps1
#requires -version 2
# NB lein -? will give help for the powershell script
# lein help will give command help for Leiningen
Param(
[Parameter(Mandatory=$true, Position = 0, HelpMessage = "The command to pass to Leiningen")]
[string]$command,
[Parameter(HelpMessage = "The version of Clojure to run. Needs to be compatible with the version of Leiningen or strange things can happen.")]
[string]$clojureVersion = "1.1.0", # e.g. 1.2.0-master-20100430.160229-59
@JulianBirch
JulianBirch / IConsumer.cs
Created June 11, 2010 17:57
Shard Balancer
using System;
namespace ColourCoding.Parallel
{
public interface IConsumer : IDisposable
{
bool Wakeup();
}
public interface IConsumer<TShard> : IConsumer
where TShard : class
@JulianBirch
JulianBirch / RSpecRunner.cs
Created July 6, 2010 17:40
RSpecRunner.cs
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using IronRuby.Builtins;
using IronRuby.Runtime;
using Microsoft.Scripting.Hosting;
@JulianBirch
JulianBirch / delta.rb
Created January 13, 2011 17:42
Dusty.rb
### This assumes that appsettings configurationpath was equal to delta.rb
ext "fixConnection" do
senderCompId "IOM"
targetCompId "JEFNET"
heartbeatInterval 60
reconnectInterval 1
protocolVersion "FIX.4.2"
shouldCheckLatency false
isInitiator true
@JulianBirch
JulianBirch / redirect.clj
Created December 14, 2011 20:10
Dealing with redirects across schemes in Ring
[ring.util.response :as res]))
; This is the code I've currently got doing redirects between http and https
(def port-override {})
(def standard-ports {:http 80 :https 443})
(defn set-override [scheme port]
(if-not (= port (standard-ports scheme))
@JulianBirch
JulianBirch / Acrostic.txt
Created August 22, 2012 14:33
Scrum described without using the word stupid.
Scrum is a best-practice software development methodology.
There are many advantages to using it in an enterprise development environment.
Unlike other methodologies, such as extreme programming, there is no need to change coding practices.
Project Managers will therefore find it easy to adopt and incorporate into their existing workflows.
Iterations with strict time-limited sprints greatly improve productivity.
Developer participation is enforced through the use of constant stand-up meetings.
@JulianBirch
JulianBirch / sprang.clj
Created September 23, 2013 20:32
Recursively dependent types
(ns sprang
(:require [clojure.core.typed :refer :all]))
(declare-protocols IValidator)
(ann-record ValidationError [validator :- IValidator
value :- Any])
(defrecord ValidationError [validator value])
; TODO: Figure out how to make occurrence typing type :errors
(ann-record ValidationResult
@JulianBirch
JulianBirch / X.md
Last active December 24, 2015 20:39

poppea

A couple of macros that do useful, general things.

Usage

The easiest way to use Poppea in your project is via Clojars.

Leiningen:

@JulianBirch
JulianBirch / lessc.clj
Created December 24, 2013 21:27
lessc watcher in Clojure
(ns lessc
(:require [pro.juxt.dirwatch :refer (watch-dir)]
[clojure.java.io :refer (file)]
[spyscope.core]
[clojure.core.async :as a]))
(defn run-less []
(println "Running LESS")
(doto
(ProcessBuilder. ["lessc" "resources/bootstrap/assets/mybootstrap.less" "resources/public/s.css"])
{-# OPTIONS_GHC -Wall #-}
module Golf where
import qualified Data.Map.Strict as M
import Data.List as L
import Data.Maybe
skip :: [a] -> Int -> [a]
skip l n = case drop n l of
(x:xs) -> x : skip xs n