Skip to content

Instantly share code, notes, and snippets.

View tkersey's full-sized avatar
:octocat:

Tim Kersey tkersey

:octocat:
View GitHub Profile
@tkersey
tkersey / iOSMemoryDeepDive.md
Created January 23, 2024 18:14
iOS Memory Deep Dive
  • vmmap --summary X.memgraph
  • vmmap X.memgraph | rg "MEMORY REGION NAME"
  • vmmap --verbose X.memgraph | rg "MEMORYREGION"
  • leaks --traceTree 0xSTARTINGMEMORYADDRESS
  • malloc_history X.memgraph --fullStacks 0xSTARTINGMEMORYADRESS
  • Other helpful commands
    • vmmap --pages X.memgraph
    • leaks X.memgraph
  • heap X.memgraph
#!/bin/sh
# Runs SwiftFormat on changed Swift files in the project.
# The re-formatting may not be caught at commit time, though, and so may require a subsequent commit/amending.
# If any command fails, exit immediately with that command's exit status.
# shellcheck disable=SC3040
set -eo pipefail
# Redirect output to stderr.
-- Yoneda --------------------------------------------------------------
newtype Yoneda f a = Yoneda { runYoneda :: forall b. ((a -> b) -> f b) }
instance Functor (Yoneda f) where
fmap f y = Yoneda (\ab -> runYoneda y (ab . f))
toYoneda :: Functor f => f a -> Yoneda f a
toYoneda fa = Yoneda (\f -> fmap f fa)
fromYoneda :: Yoneda f a -> f a
@tkersey
tkersey / LinkerSetting.swift
Last active October 24, 2023 14:19
Package.swift Settings
extension LinkerSetting {
static var mergeable: Self = unsafeFlags([
"-Wl,-make_mergeable",
"-Wl,-no_exported_symbols",
])
}
@tkersey
tkersey / pas.ts
Created September 24, 2023 17:27
TypeScript Proposition as Types
// https://www.typescriptlang.org/play?#code/PTAEDMEMBsGcFNQAcBOB7JbYEsAu20A7UQUqIAoXATyUQBUUBXRAXlAcIGtC0B3QgbjJkQoXI0SoMWPAWKASogrVEAMRgJQrQvABu8FIOFgAItlgArdgGN8RUAEFQgCiJQAIUU1QAeRQAeOwBpXAD4NUDJQUAAfUABvUUgAcwAuUAAiaHhwXFT+UG0YJhSHAF8wiOi43ESU1JRsBIALbNz86ELXUGKDMnArG2IMrL8ggApW9rsAShTvP0CtXRQQmPDQFHhcBhRiSuq0wezA8cQusmKhXsJrWTX6pp8XUeOUl2mvXwW9QMfY1fXN7axeLJNJ1RqHPIFE6Cc49Po3eB4Bp6OauQIAYVGqzQKBmvgCwX82MIABlMrgUiNIEVJhoQuiiREiAAlO4U0AjABGL1pzHpRLe6N+fw2W2II1WTJQADoqgkNMxWOlyakyhF1QB+UBEMlZEY46XHWmS9UpFls-Uyo2rSYwoSGUDoogWK79eygQDkRK53Ig7IQACaon6sADaBJcAF1uiIAJIAWyQ0GwlkgbocAFoQm4qB540ggyFWFSaXTXAYRABRACODGwrXgV19oB8fO9OcQMfA4ALoRDeYLgX7LkCdiCUaEIgAcvAEqmbgBCOw+0CTtC4YahEYADxLrc++ntImU2BQsFwoFTuHgCfPuDQyHQ-oYlkQkBXM7nulESjhrpuUGwDJ-QAfS0BJgMva8kFwEZaRWVZLmuWxwBxHQUVHYt7Dgk1-jFCBUMWKlbVWUohAids0HAfD1kWVYRHVAA9DV7QiRC3X9NAGE5DJQJnYYRi7SkU2gaBOUgSwOEpaksNLfdeRCOSil+dVQBAE02JuHhIDwYCUJovRMKmFJ92UlS1lFQEtJ0vS0JQIjBBU2EVNwwEuxGKzcF0gi9GIiJznIpRKNADiuJ4sC6LARjmIiejsEQVd1wS4YgjI0AMnPaTCAYONOT0UIQu4+BeISEYOFLDgRg
@tkersey
tkersey / algebraic-effects-series-4.md
Created June 30, 2023 22:33 — forked from yelouafi/algebraic-effects-series-4.md
Implementing Algebraic Effects and Handlers

Algebraic Effects in JavaScript part 4 - Implementing Algebraic Effects and Handlers

This is the final part of a series about Algebraic Effects and Handlers.

So we've come to the core topic. The reality is that we've already covered most of it in the previous parts. Especially, in the third part, where we saw delimited continuations at work.

@tkersey
tkersey / cli.txt
Created May 29, 2023 16:22
macOS format SD card for Miyoo Mini Plus
sudo diskutil eraseDisk FAT32 SDCARD MBRFormat /dev/disk2
@tkersey
tkersey / CoC.ml
Created February 25, 2023 22:50 — forked from hirrolot/CoC.ml
How to implement dependent types in 80 lines of code
type term =
| Lam of (term -> term)
| Pi of term * (term -> term)
| Appl of term * term
| Ann of term * term
| FreeVar of int
| Star
| Box
let unfurl lvl f = f (FreeVar lvl)
@tkersey
tkersey / youtube.md
Created January 28, 2023 19:15 — forked from bitsurgeon/youtube.md
Markdown cheatsheet for YouTube

Embed YouTube Video in Markdown File

  1. Markdown style
[![Watch the video](https://img.youtube.com/vi/nTQUwghvy5Q/default.jpg)](https://youtu.be/nTQUwghvy5Q)
  1. HTML style
<a href="http://www.youtube.com/watch?feature=player_embedded&v=nTQUwghvy5Q" target="_blank">