Skip to content

Instantly share code, notes, and snippets.

@samwarnick
samwarnick / machine.js
Created September 11, 2019 15:09
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@samwarnick
samwarnick / migrate.swift
Last active January 25, 2023 16:11
Migrate to app group
// In my core data stack
let container = NSPersistentCloudKitContainer(name: "DataModel")
let storeUrl = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: groupIdentifier)!.appendingPathComponent("DataModel.sqlite")
// Enable history tracking and remote notifications
guard let description = container.persistentStoreDescriptions.first else {
fatalError("###\(#function): Failed to retrieve a persistent store description.")
}
description.setOption(true as NSNumber, forKey: NSPersistentHistoryTrackingKey)
description.setOption(true as NSNumber, forKey: NSPersistentStoreRemoteChangeNotificationPostOptionKey)
local wezterm = require("wezterm")
local config = wezterm.config_builder()
local scheme = "terafox"
local scheme_def = wezterm.color.get_builtin_schemes()[scheme]
config.color_scheme = scheme
config.colors = {
tab_bar = {
background = "none",
active_tab = {