Skip to content

Instantly share code, notes, and snippets.

View eticzon's full-sized avatar

Erwin eticzon

  • Sydney, Australia
View GitHub Profile
@eticzon
eticzon / web-servers.md
Created January 18, 2020 06:48 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@eticzon
eticzon / gitflow-breakdown.md
Created December 12, 2019 02:17 — forked from JamesMGreene/gitflow-breakdown.md
A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@eticzon
eticzon / gitflow-breakdown.md
Created December 12, 2019 02:17 — forked from JamesMGreene/gitflow-breakdown.md
A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

FWIW: I didn't produce the content presented here (the outline from Edmond Lau's book). I've just copy-pasted it from somewhere over the Internet, but I cannot remember what exactly the original source is. I was also not able to find the author's name, so I cannot give him/her the proper credits.


Effective Engineer - Notes

What's an Effective Engineer?

{
"game": {
"gameMetadata": {
"duration": {
"hours": 0,
"minutes": 3,
"seconds": 1,
"secondsElapsed": 181
},
"endGameResult": "NOT_ENDED",
@eticzon
eticzon / States-v3.md
Created February 17, 2019 11:19 — forked from andymatuschak/States-v3.md
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,

@eticzon
eticzon / no-aaaa.py
Created July 5, 2017 11:27 — forked from FiloSottile/no-aaaa.py
Unbound python-script to route websites over IPv4.
def init(id, cfg):
return True
def deinit(id):
return True
def inform_super(id, qstate, superqstate, qdata):
return True
domains = [
package main
import (
"fmt"
)
type Fetcher interface {
// Fetch returns the body of URL and
// a slice of URLs found on that page.
Fetch(url string) (body string, urls []string, err error)
package main
import (
"fmt"
)
type Fetcher interface {
// Fetch returns the body of URL and
// a slice of URLs found on that page.
Fetch(url string) (body string, urls []string, err error)
#!/bin/bash
# Some crude checks here ...
[[ $1 != "" && -d $1 ]] && logs_dir=$1 || exit 1
# And another ...
case $2 in
*zalora*)
zalora_uri=$2
;;