Skip to content

Instantly share code, notes, and snippets.

View Dast1Woop's full-sized avatar
🎯
Focusing

myl Dast1Woop

🎯
Focusing
View GitHub Profile
@Dast1Woop
Dast1Woop / Bluetooth-Company-Identifiers.csv
Created September 9, 2024 05:47 — forked from angorb/Bluetooth-Company-Identifiers.csv
[Bluetooth Company Identifiers] Company identifiers are unique numbers assigned by the Bluetooth SIG to member companies requesting one.
0x0000 Ericsson Technology Licensing
0x0001 Nokia Mobile Phones
0x0002 Intel Corp.
0x0003 IBM Corp.
0x0004 Toshiba Corp.
0x0005 3Com
0x0006 Microsoft
0x0007 Lucent
0x0008 Motorola
0x0009 Infineon Technologies AG
@Dast1Woop
Dast1Woop / States-v3.md
Created August 6, 2024 15:11 — 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,

@Dast1Woop
Dast1Woop / Storage.swift
Created October 27, 2021 01:51 — forked from saoudrizwan/Storage.swift
Helper class to easily store and retrieve Codable structs from/to disk. https://medium.com/@sdrzn/swift-4-codable-lets-make-things-even-easier-c793b6cf29e1
import Foundation
public class Storage {
fileprivate init() { }
enum Directory {
// Only documents and other data that is user-generated, or that cannot otherwise be recreated by your application, should be stored in the <Application_Home>/Documents directory and will be automatically backed up by iCloud.
case documents