Skip to content

Instantly share code, notes, and snippets.

View samdeane's full-sized avatar
💭
wrangling code

Sam Deane samdeane

💭
wrangling code
View GitHub Profile
@samdeane
samdeane / SimpleEditableModel.swift
Last active August 14, 2022 22:02
A simple pattern for a SwiftUI editable model
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// Created by Sam Deane on 17/06/22.
// All code (c) 2022 - present day, Elegant Chaos Limited.
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
import SwiftUI
// MARK: Application
@main
@samdeane
samdeane / ContentView.swift
Created February 3, 2022 14:20
ContentView illustrating nasty transition for a searchable ScrollView
import SwiftUI
struct ContentView: View {
@State var text = ""
var body: some View {
TabView {
NavigationView {
ScrollView {
LazyVStack(alignment: .leading) {

Keybase proof

I hereby claim:

  • I am samdeane on github.
  • I am samdeane (https://keybase.io/samdeane) on keybase.
  • I have a public key ASD7E3R8Nv9oO_v_td5Q1XMtU0iWVjcvgtdV8Lp7YEBiAAo

To claim this, I am signing this object:

#!/bin/sh
# Create a RAM disk with same perms as mountpoint
# Script based on http://itux.idev.pro/2012/04/iservice-speed-up-your-xcode-%D0%BD%D0%B5%D0%BA%D0%BE%D1%82%D0%BE%D1%80%D1%8B%D0%B5-%D1%81%D0%BF%D0%BE%D1%81%D0%BE%D0%B1%D1%8B/ with some additions
# Usage: sudo ./xcode_ramdisk.sh start
USERNAME=$(logname)
TMP_DIR="/private/tmp"
RUN_DIR="/var/run"
SYS_CACHES_DIR="/Library/Caches"
@samdeane
samdeane / fixgit.sh
Created August 19, 2012 13:26
Script to move a git repo containing absolute gitdir and worktree submodule paths
#!/usr/bin/env bash
# Fix up a git repo containing submodules that have absolute paths which have changed.
#
# Note that this doesn't do the *proper* fix, which is to turn the absolute paths into
# relative paths. This is possible, but would require a lot more logic because the relative
# paths would be different in each case.
#
# What it does instead is a pragmatic workaround, which is to search & replace the old
# path with a new (and presumably correct) one. This will get you up and running again.
@samdeane
samdeane / GlobalSettings.plist
Created August 2, 2012 16:25
Script for generating appledoc docs
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>--project-company</key>
<string>Elegant Chaos</string>
<key>--company-id</key>
<string>com.elegantchaos</string>
<key>--keep-undocumented-objects</key>
<false/>