Skip to content

Instantly share code, notes, and snippets.

View spirosoik's full-sized avatar
🎷
Jazz addicted

Spiros Economakis spirosoik

🎷
Jazz addicted
View GitHub Profile
@iMilnb
iMilnb / aws_sandbox.md
Last active September 26, 2018 16:30
Custom AWS sandbox using packer, Troposphere / CloudFormation and Ansible

packer template

{
  "variables": {
    "aws_access_key": "",
    "aws_secret_key": ""
  },
  "builders": [{
    "type": "amazon-ebs",
@andymatuschak
andymatuschak / States-v3.md
Last active June 12, 2024 04:17
A composable pattern for pure state machines with effects (draft v3)

A composable pattern for pure state machines with effects

State machines are everywhere in interactive systems, but they're rarely defined clearly and explicitly. Given some big blob of code including implicit state machines, which transitions are possible and under what conditions? What effects take place on what transitions?

There are existing design patterns for state machines, but all the patterns I've seen complect side effects with the structure of the state machine itself. Instances of these patterns are difficult to test without mocking, and they end up with more dependencies. Worse, the classic patterns compose poorly: hierarchical state machines are typically not straightforward extensions. The functional programming world has solutions, but they don't transpose neatly enough to be broadly usable in mainstream languages.

Here I present a composable pattern for pure state machiness with effects,

@gosuri
gosuri / terraformer.go
Created September 4, 2015 18:28
Using terraform with go
package terraformer
import (
"bytes"
"errors"
"path"
"path/filepath"
"...runtime"
"...store"
@pablomoretti
pablomoretti / gist:9748230
Created March 24, 2014 20:17
SimpleDateFormatThreadSafe
package com.foocoders.text;
import java.text.AttributedCharacterIterator;
import java.text.DateFormatSymbols;
import java.text.FieldPosition;
import java.text.NumberFormat;
import java.text.ParseException;
import java.text.ParsePosition;
import java.text.SimpleDateFormat;
import java.util.Calendar;
@pzurek
pzurek / Twelve_Go_Best_Practices.md
Last active March 16, 2024 14:19
Twelve Go Best Practices
@dingzhihu
dingzhihu / conflicting_strings.rb
Created September 8, 2012 03:16
find duplicate strings in android string resources
#!/usr/bin/env ruby -w
# find duplicate strings in android string resources
# usage: ruby conflicting_strings strings.xml other_strings.xml
require 'xmlsimple'
def parse_string_resources(file_name)
strings = XmlSimple.xml_in(file_name)['string']