Skip to content

Instantly share code, notes, and snippets.

View dfcarpenter's full-sized avatar

Daniel Carpenter dfcarpenter

View GitHub Profile
@dfcarpenter
dfcarpenter / railway_oriented_programming.clj
Created October 16, 2018 22:30 — forked from ah45/railway_oriented_programming.clj
Railway Oriented Programming in Clojure using (funcool) Cats
(ns railway-oriented-programming
"An adaptation of [Railway Oriented Programming](rop) using the
[Cats](cats) library in Clojure.
[rop]: http://fsharpforfunandprofit.com/posts/recipe-part2/
[cats]: https://github.com/funcool/cats"
(:require [cats.builtin]
[cats.core :as cats]
[cats.monad.either :as either]))
@dfcarpenter
dfcarpenter / CodeEditor.elm
Created August 22, 2018 21:03 — forked from lukewestby/CodeEditor.elm
The custom element and Elm API that will drive Ellie's code editors
module Ellie.Ui.CodeEditor
exposing
( Attribute
, LinterMessage
, Position
, Severity(..)
, linterMessages
, mode
, onChange
, readOnly
@dfcarpenter
dfcarpenter / astar.clj
Created August 16, 2018 23:22 — forked from reborg/astar.clj
Clojure implementation of the A* path finding algorithm
;; This is the Wikipedia entry example encoded graph.
(def graph {:orig [{:a 1.5 :d 2} 0]
:a [{:orig 1.5 :b 2} 4]
:b [{:a 2 :c 3} 2]
:c [{:b 3 :dest 4} 4]
:dest [{:c 4 :e 2} 0]
:e [{:dest 2 :d 3} 2]
:d [{:orig 2 :e 3} 4.5]})
(defn a* [graph orig dest]
@dfcarpenter
dfcarpenter / core.clj
Created March 23, 2018 21:00 — forked from maacl/core.clj
Domain Modelling using Clojure
(comment "This is a small experiment inspired by Oskar Wickströms
excellent work at
https://haskell-at-work.com/episodes/2018-01-19-domain-modelling-with-haskell-data-structures.html.
I wanted to see what would be involved in building the equivalent
functionality in reasonably ideomatic Clojure. It is also my first
from scratch use of Clojure spec, which was a very interesting and
productive experience. It is amazing how little work one has to do
to be able to generate example datastructures for testing. The
generated examples helped me find a subtle bug in the tree pretty
printer, that would have been hard to find without." "I would love
@dfcarpenter
dfcarpenter / README
Created January 21, 2016 22:20 — forked from mremond/README
Phoenix Elixir framework with ejabberd - Tutorial
Please read original blog post for reference:
http://blog.process-one.net/embedding-ejabberd-into-an-elixir-phoenix-web-application/