Skip to content

Instantly share code, notes, and snippets.

View archie's full-sized avatar
😃

Marcus Ljungblad archie

😃
View GitHub Profile
@archie
archie / notes.txt
Created June 29, 2015 20:06
Notes from More Women in Tech meetup #cphftw
Sponsors
Rainmaking Loft
- how do we look at startups, not only funding and practical stuff
- looking at diversity as a metric when deciding who can stay at the loft
IBM
- contributing in a wide capacity
- Women in Tech 51% overall, 26% in IT
- 3% tech companies are funded by women, 6.5 % have female ceo, venture backed
- 12% of CS degrees, in the 80s same fig was 37%, 2012 18%
@archie
archie / upptec_pipes.ex
Last active August 29, 2015 14:01
Playing with pipes in Elixir
defmodule Upptec do
def study(topics, match) do
Stream.filter(topics, fn topic -> Regex.match?(match, topic) end)
end
def consider(topics, time_available) do
Stream.map(topics, fn topic ->
duration = :random.uniform(time_available)
{topic, duration}
end)
@archie
archie / gist:11136979
Created April 21, 2014 09:05
curl -I aftonbladet.se
% curl -I www.aftonbladet.se
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
X-UA-Compatible: IE=edge,chrome=1
Content-Type: text/html;charset=utf-8
Vary: Accept-Encoding,X-AB-Device-Type
X-Varnish: 1951083729
Via: 1.1 varnish
Cache-Control: private,s-maxage=0
@archie
archie / ddd_cqrs_es.md
Last active May 20, 2019 07:36
Draft blog post about ddd, cqrs, and es.

DDD, CQRS and Event Sourcing

In preparation for a new gig I'm reading up on the terms Domain-Driven Design, Command-Query Responsibility Segregation, and Event Sourcing. Here are a list of useful texts and talks that I've discovered so far. If anything is missing please leave a comment.

DDD

Demokratiappen API

Draft 1

Inspiration gathered from Foursquare and Bit.ly APIs.

Guidelines

Request/Response formats

public void process3(java.util.List<?>);
Code:
0: aload_1
1: invokeinterface #2, 1 // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
6: astore_2
7: aload_2
8: invokeinterface #3, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z
13: ifeq 31
16: aload_2
17: invokeinterface #4, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
@archie
archie / Viewer.java
Last active August 29, 2015 13:57
Exploring wildcard types, or the so called question mark type, in Java.
package wild;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class Viewer {
public void process1(List<Object> items) {
for (Object i : items)
@archie
archie / ParentChild.scala
Created December 13, 2013 22:42
Examples of testing Akka actor parent-child relationships, mostly based on findings from https://www.assembla.com/spaces/akka/tickets/3043#/activity/ticket:
package pc
import akka.actor.Actor
import akka.actor.Props
import akka.actor.ActorRef
import akka.actor.ActorRefFactory
class Parent extends Actor {
val child = context.actorOf(Props[Child], "child")
var ponged = false
@archie
archie / EchoSpec.scala
Last active December 30, 2015 23:39
This does not compile since ImplicitSender depends on TestKit and not TestKitBase. Error message: "illegal inheritance; self-type demo.EchoSpec does not conform to akka.testkit.ImplicitSender's selftype akka.testkit.ImplicitSender with akka.testkit.TestKit [---] line 18"
package demo
import org.scalatest._
import akka.testkit.TestKit
import akka.actor.Actor
import akka.actor.ActorSystem
import akka.testkit.TestKitBase
import akka.testkit.ImplicitSender
import akka.actor.Props
@archie
archie / Log.scala
Created November 25, 2013 14:34
Using "Pimp my library" pattern to add customised functionality to a Scala Vector.
package raft
import scala.language.implicitConversions
import akka.actor.ActorRef
abstract class Entry[T](val command: T, val term: Int, val sender: (ActorRef, Int))
case class StringEntry(
override val command: String,
override val term: Int,