Skip to content

Instantly share code, notes, and snippets.

View bartleby's full-sized avatar
🦄
One More Time

Aleksei Artemev bartleby

🦄
One More Time
View GitHub Profile
@andymatuschak
andymatuschak / States-v3.md
Last active March 23, 2024 04:53
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,

@mteece
mteece / timezone.md
Last active July 29, 2022 22:12
List of NSTimeZone Abbreviations and Names (iOS 9.3.1)

NSTimeZone - Timezone Abbreviations ADT = "America/Halifax"; AKDT = "America/Juneau"; AKST = "America/Juneau"; ART = "America/Argentina/Buenos_Aires"; AST = "America/Halifax"; BDT = "Asia/Dhaka"; BRST = "America/Sao_Paulo"; BRT = "America/Sao_Paulo"; BST = "Europe/London";

@shazron
shazron / gist:943736
Created April 27, 2011 04:55
About XCode 4 Project Template (How To Create Custom Project Template)
From: http://snipt.net/yonishin/about-xcode-4-project-template
XCode 4 Projects and Files Template Folder: /Developer/Library/Xcode/Templates
Examples:
/Developer/Library/Xcode/Templates/Project Templates/Base/Other/Empty.xctemplate
/Developer/Library/Xcode/Templates/Project Templates/Base/Base.xctemplate
/Developer/Library/Xcode/Templates/Project Templates/Mac/Mac Base.xctemplate
/Developer/Library/Xcode/Templates/Project Templates/Mac/Application/Command Line Tool.xctemplate
/Developer/Library/Xcode/Templates/Project Templates/Mac/Application/Cocoa Application.xctemplate