Skip to content

Instantly share code, notes, and snippets.

@boysbee
boysbee / PrometheusMetricsController.scala
Created May 2, 2017 18:52 — forked from jnesbitt/PrometheusMetricsController.scala
Prometheus metrics controller for Play! Framework 2.5
package controllers
import java.io.Writer
import akka.util.ByteString
import io.prometheus.client._
import io.prometheus.client.exporter.common.TextFormat
import play.api.http.HttpEntity
import play.api.mvc._
@brendanzab
brendanzab / reactive_systems_bibliography.md
Last active October 10, 2022 06:36
A reading list that I'm collecting while building my Rust ES+CQRS framework: https://github.com/brendanzab/chronicle

Functional, Reactive, and Distributed Systems Bibliography

Books

This document has moved!

It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.

@BretFisher
BretFisher / .travis.yml
Created February 15, 2016 21:26
Travis-CI Docker Image Build and Push to AWS ECR
sudo: required #is required to use docker service in travis
language: php #can be any language, just php for example
services:
- docker # required, but travis uses older version of docker :(
install:
- echo "install nothing!" # put your normal pre-testing installs here
@staltz
staltz / introrx.md
Last active April 25, 2024 04:18
The introduction to Reactive Programming you've been missing
@eulerfx
eulerfx / EventMachines.md
Last active September 8, 2023 22:42
The relationship between state machines and event sourcing

A state machine is defined as follows:

  • Input - a set of inputs
  • Output - a set of outputs
  • State - a set of states
  • S0 ∈ S - an initial state
  • T : Input * State -> Output * State - a transition function

If you model your services (aggregates, projections, process managers, sagas, whatever) as state machines, one issue to address is management of State. There must be a mechanism to provide State to the state machine, and to persist resulting State for subsequent retrieval. One way to address this is by storing State is a key-value store. Another way is to use a SQL database. Yet another way is event sourcing. The benefit of even sourcing is that you never need to store State itself. Instead, you rely on the Output of a service to reconstitute state. In order to do that, the state machine transition function needs to be factored into two functions as follows:

@bryanhunter
bryanhunter / ndc-oslo-2014.md
Last active April 10, 2016 11:40
NDC Oslo 2014 - FP Cheat Sheet

#The Functional Programmers Cheat Sheet for NDC Oslo 2014

This year NDC Oslo has a full three-day functional programming track with an amazing lineup. If you agree that the future of programming is FP, use this as your "auto pilot" guide on what sessions to attend.

Cheer for sessions on Twitter using the #ndcoslo and #fptrack hashtags.

[The full agenda (including non-fp sessions) is here].

@tony4d
tony4d / p4merge4git.md
Created August 24, 2012 19:00
Setup p4merge as a visual diff and merge tool for git
@thinktainer
thinktainer / .gitignore
Created January 14, 2012 10:49
Visual Studio gitignore file
#OS junk files
[Tt]humbs.db
*.DS_Store
#Visual Studio files
*.[Oo]bj
*.user
*.aps
*.pch
*.vspscc
@jcf
jcf / email_validator.rb
Created September 2, 2011 10:48 — forked from stauntonknight/email_validator.rb
Rails 3 Email Validator
require 'mail'
class EmailValidator < ActiveModel::EachValidator
attr_reader :record, :attribute, :value, :email, :tree
def validate_each(record, attribute, value)
@record, @attribute, @value = record, attribute, value
@email = Mail::Address.new(value)
@tree = email.__send__(:tree)