Skip to content

Instantly share code, notes, and snippets.

View Arnauld's full-sized avatar
🐻‍❄️

Arnauld Loyer Arnauld

🐻‍❄️
View GitHub Profile
package sequencer;
import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.function.Supplier;
/**
* @author <a href="http://twitter.com/aloyer">@aloyer</a>
@Arnauld
Arnauld / pom.xml
Created May 27, 2014 14:45
robothack pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.technbolts</groupId>
<artifactId>nethack</artifactId>
<version>1.0-SNAPSHOT</version>
Handlers
In Domain Driven Design, there are a series of small services that sit over the top of the domain. These services known as Application Services act as a facade over the the domain model. In CQRS based systems a similar pattern is used but it has been slightly refined. The refining of this pattern can be employed successfully in both systems that use CQRS and systems that stay using a single model for supporting reads and writes as many of the advantages come from simplicity of composition. To show Command Handlers, it is best to start with a typical Application Service and refactor our way to a Command Handler.
The Application Service
A stereotypical Application Service represents a given use case of the model. The Application Service itself generally does not directly implement the use case but instead coordinates objects from the domain to meet the requirements of the use case. This sounds like a small distinction but it is a very important one, Application Services generally should not have "l
@Arnauld
Arnauld / Player.clj
Created December 19, 2014 10:25
Platinum-rift [CLOJURE]
(ns Player
(:gen-class)
(:import (java.io StringReader)
(clojure.lang LineNumberingPushbackReader PersistentQueue))
(:use clojure.set))
;---------------------------------------------------------------
; _ _ _ _ _ _
; _ _| |_(_) (_) |_(_) ___ ___
@Arnauld
Arnauld / kata-roadmap-01.md
Last active August 29, 2015 14:23
Kata - roadmap

Roman Numerals Kata

The Romans wrote their numbers using letters; specifically the letters 'I' meaning '1', 'V' meaning '5', 'X' meaning '10', 'L' meaning '50', 'C' meaning '100', 'D' meaning '500', and 'M' meaning '1000'.

There were certain rules that the numerals followed which should be observed:

  • The symbols 'I', 'X', 'C', and 'M' can be repeated at most 3 times in a row.
  • The symbols 'V', 'L', and 'D' can never be repeated.
  • The '1' symbols ('I', 'X', and 'C') can only be subtracted from the 2 next highest values ('IV' and 'IX', 'XL' and 'XC', 'CD' and 'CM').
  • Only one subtraction can be made per numeral ('XC' is allowed, 'XXC' is not).
F# Interactive for F# 3.1 (Open Source Edition)
Freely distributed under the Apache 2.0 Open Source License
For help type #help;;
>
>
[BuildingCard {color = Blue;
number = 1;}; BuildingCard {color = Red;
number = 1;};
BuildingCard {color = Yellow;
// Learn more about F# at http://fsharp.net. See the 'F# Tutorial' project
// for more guidance on F# programming.
#light
open Microsoft.FSharp.Reflection
let Fail message = failwith message
let IsTrue(success) = if not success then failwith "Expected true"
let AreEqual(expected, actual) =
if not (expected = actual) then
@Arnauld
Arnauld / Glob.scala
Created April 19, 2011 10:58
A Glob matcher implementation that does not rely on regex. Simple exercice of a parser by hand...
package steam.util
import collection.mutable.ListBuffer
/**
* A glob pattern is specified as a string and is matched against other strings,
* such as directory or file names. Glob syntax follows several simple rules:
* <ul>
* <li>
* An asterisk, *, matches any number of characters (including none).
@Arnauld
Arnauld / gist:1719793
Created February 1, 2012 22:10
Yesod installation round 2 - Beginner:1 Yesod:0

List all user based library and clean up!

$ ghc-pkg list > ghc-pkg.list && subl ghc-pkg.list

$ ghc-pkg unregister --user --force unordered-containers-0.1.4.6
$ ghc-pkg unregister --user --force vector-0.9.1
$ ghc-pkg unregister --user --force xml-conduit-0.5.2
$ ghc-pkg unregister --user --force xml-types-0.3.1
$ ghc-pkg unregister --user --force yaml-0.5.2

$ ...