Skip to content

Instantly share code, notes, and snippets.

Julian Birch JulianBirch

Block or report user

Report or block JulianBirch

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View GeoControl.txt
Good morning, oregenes and guardians
Stills and mother-losing grits
This a ten-ringer named 'Baster coming
And he's here to end your world,
Start a tale that will soon be classic
About a woman you already no
No four-ringer she but rather the saviour of your species
Geo Control (Are you ready?)
Our story begins in the fulcrum
View Day19.hs
module Day19 where
import Data.Maybe (maybe)
import Data.List (find, findIndex, unfoldr)
import Data.Char (isLetter)
day19text :: IO [[Char]] -- We could use a better data structure, but the code only gets run once
day19text = lines <$> readFile "C:\\Users\\me\\advent\\day19.txt"
isWire :: Char -> Bool
View IConsumer.cs
using System;
namespace ColourCoding.Parallel
{
public interface IConsumer : IDisposable
{
bool Wakeup();
}
public interface IConsumer<TShard> : IConsumer
where TShard : class
View ClojureScript
Exception in thread "main" java.lang.AbstractMethodError: cljsbuild.compiler.SourcePaths._find_sources(Ljava/lang/Object;)Ljava/lang/Object;, compiling:(/tmp/form-init5931832452504796267.clj:1:73)
at clojure.lang.Compiler.load(Compiler.java:7239)
at clojure.lang.Compiler.loadFile(Compiler.java:7165)
at clojure.main$load_script.invoke(main.clj:275)
at clojure.main$init_opt.invoke(main.clj:280)
at clojure.main$initialize.invoke(main.clj:308)
at clojure.main$null_opt.invoke(main.clj:343)
at clojure.main$main.doInvoke(main.clj:421)
at clojure.lang.RestFn.invoke(RestFn.java:421)
at clojure.lang.Var.invoke(Var.java:383)
View Modern FP with mtl.hs
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
import Control.Monad.IO.Class
import Control.Monad.Trans.Class
import Prelude hiding (log)
--------------------------------------------------------------------------------
-- The API for cloud files.
class Monad m => MonadCloud m where
saveFile :: Path -> Bytes -> m ()
@JulianBirch
JulianBirch / lessc.clj
Created Dec 24, 2013
lessc watcher in Clojure
View lessc.clj
(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"])
View X.md

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 / sprang.clj
Created Sep 23, 2013
Recursively dependent types
View sprang.clj
(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 / Acrostic.txt
Created Aug 22, 2012
Scrum described without using the word stupid.
View Acrostic.txt
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 / redirect.clj
Created Dec 14, 2011
Dealing with redirects across schemes in Ring
View redirect.clj
[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))
You can’t perform that action at this time.