Skip to content

Instantly share code, notes, and snippets.

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

Arnauld Loyer Arnauld

🐻‍❄️
View GitHub Profile
@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

$ ...

//--- Constraint.java
package grid;
import java.util.regex.Pattern;
/**
* @author <a href="http://twitter.com/aloyer">@aloyer</a>
*/
public class Constraint {
private final Pattern pattern;
Scenario: Create an invoice
Given an authenticated admin
And a new client with an associated work unit
When the global invoiced is set with a valid value
Then the new client should not appear anymore

TIPS - Process

Communication, communication, communication

  • Bridge the communication gap between business and technology
  • Faster feedback

Get Involved Early

@Arnauld
Arnauld / SpringBuilder.java
Created November 29, 2013 20:37
A builder to ease the creation of Spring context.
import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
import org.springframework.context.ApplicationContextInitializer;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.core.io.Resource;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
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.java
Created December 19, 2014 10:23
Platinum-rift [JAVA]
import java.io.ByteArrayOutputStream;
import java.io.FilterInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintStream;
import java.util.*;
/**
*
*/