Skip to content

Instantly share code, notes, and snippets.

View mattgreen's full-sized avatar

Matt Green mattgreen

View GitHub Profile
@tkhelm
tkhelm / CoreDataWithCombine.swift
Last active December 27, 2023 08:37
CoreDataWithCombine
//******* STORAGE MODEL ****************
import CoreData
import Combine
class URLMetadataStorage: NSObject, ObservableObject {
static let shared = URLMetadataStorage()
let parentContext = PersistenceController.shared.container.viewContext
@unprovable
unprovable / mbedtls_gcm_esp32_example.ino
Last active December 7, 2022 02:08
MBEDTLS AES GCM example
// This is shockingly bad code... but I threw it together in ~4mins...
// because I couldn't find one anywhere and needed it for some ESP32 experimentation...
// See the MBED reference for this:
// https://tls.mbed.org/api/gcm_8h.html
#include "mbedtls/gcm.h"
void setup() {
Serial.begin(115200);
mbedtls_gcm_context aes;
" Load plug
call plug#begin('~/.config/nvim/bundle')
Plug 'airblade/vim-gitgutter'
Plug 'editorconfig/editorconfig-vim'
Plug 'gregsexton/MatchTag'
Plug 'honza/vim-snippets'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': 'yes \| ./install --all' }
Plug 'junegunn/fzf.vim'
Plug 'junegunn/vim-easy-align'
@BaseCase
BaseCase / dc_2017_biblio.md
Last active January 23, 2020 05:13
List of resources recommended or mentioned by the speakers at Deconstruct 2017

Deconstruct 2017 Bibliography

Here are all of the resources mentioned by Deconstruct 2017 speakers, along with who recommended what. Please post a comment if I missed something or have an error!

DC 2017 Speakers' Choice Gold Medalist

  • Seeing Like a State by James Scott

Books

  • Public Opinion by Walter Lippmann (Evan Czaplicki)
  • A Pattern Language by Christopher Alexander (Brian Marick)
  • Domain Driven Design by Eric Evans (Brian Marick)
@kevinelliott
kevinelliott / 1-macOS-10.12-sierra-setup.md
Last active February 5, 2024 07:22
macOS 10.12 Sierra Setup

macOS 10.12 Sierra Setup

Custom recipe to get macOS 10.12 Sierra running from scratch, setup applications and developer environment. This is very similar (and currently mostly the same) as my 10.11 El Capitan setup recipe and 10.10 Yosemite setup recipe. I am currently tweaking this for 10.12 Sierra and expect to refine this gist over the next few weeks.

I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. I generally reinstall each computer from scratch every 6 months, and I do not perform upgrades between releases.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your o

@andymatuschak
andymatuschak / States-v3.md
Last active November 14, 2024 18:33
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,

@steinwaywhw
steinwaywhw / reg-exp-fn.sml.md
Created September 13, 2015 23:55
A Copy of ml-ulex Source Code

I pasted it here because it is hard to find for me. It is publicly available at here. The total order and canonical form is clearly presented here over the original ml-ulex paper.

(* reg-exp-fn.sml
 *
 * COPYRIGHT (c) 2005 
 * John Reppy (http://www.cs.uchicago.edu/~jhr)
 * Aaron Turon ([email protected])
 * All rights reserved.
@cheery
cheery / cek.py
Created May 10, 2015 12:53
CEK abstract machine
# I glanced through the pycket paper, saw few rules there. Ended up to doing this.
class Var(object):
def __init__(self, name):
self.name = name
def __repr__(self):
return self.name
class Lam(object):