Skip to content

Instantly share code, notes, and snippets.

@marcoarment
marcoarment / privacy.markdown
Created February 24, 2026 20:58
Reminder privacy policy

PRIVACY POLICY

This policy applies to all information collected or submitted on Full City, LLC's website and apps.

INFORMATION WE COLLECT

The Reminder app has no servers, services, or accounts, and collects no data from users.

All tasks are read from and written to the iOS or macOS Reminders database.

//
// OCXML.swift
// Created by Marco Arment on 9/23/24.
//
// Released into the public domain. Do whatever you'd like with this.
// No guarantees that it'll do anything, or do it correctly. Good luck!
//
import Foundation
@marcoarment
marcoarment / OCObservableKeyPaths.swift
Last active January 18, 2024 06:01
A Combine publisher for `@Observable` key-paths
// I think this works and doesn't create circular references?
/*
Usage: Add OCObservableKeyPaths conformance to the observed type. Then, e.g.
audioPlayer
.publisher(forObservableKeyPaths: [ \.timestamp, \.duration ])
.sink {
// respond to change
}
@marcoarment
marcoarment / Searchable_iOS16.swift
Created July 11, 2023 19:23
Backporting iOS 17's SwiftUI .searchable($isPresented) binding for iOS 16
import SwiftUI
extension View {
public func searchable_iOS16(text: Binding<String>, isPresented: Binding<Bool>, placement: SearchFieldPlacement) -> some View {
modifier(Searchable_iOS16(text: text, isPresented: isPresented, placement: placement))
}
}
public struct Searchable_iOS16: ViewModifier {
@Binding var text: String
@marcoarment
marcoarment / Text+InlineSymbol.swift
Last active October 26, 2023 17:13
SwiftUI Text with inline SF Symbols
import SwiftUI
extension Text {
public struct InlineSymbol {
public let name: String
public let accessibilityLabel: String
public let color: Color?
public init(name: String, accessibilityLabel: String, color: Color? = nil) {
self.name = name
import SwiftUI
struct ContentView: View {
@State var numbers = [1, 2, 3, 4, 5, 6, 7, 8]
var body: some View {
Button {
withAnimation {
numbers.append(Int.random(in: 9..<99))
numbers.sort()
#!/bin/bash
shopt -s nullglob
LOCALUSER=marco # Change this for you, obviously
DISABLED_FILES_DIR=/Users/$LOCALUSER/.quit-adobe
# Are any Adobe user-facing apps running? Assuming they begin with "Adobe ", e.g. "Adobe Audition 2022"
ps ax -c -o 'command=' | egrep '^Adobe ' | fgrep -v 'Adobe Desktop Service' | fgrep -v 'Adobe Installer' > /dev/null
if [ $? -eq 1 ] ; then
import SwiftUI
extension UIColor: Identifiable {
public var id: String {
get { self.accessibilityName }
}
}
struct ContentView: View {
@marcoarment
marcoarment / S3.php
Last active July 8, 2025 17:39
A simple PHP class to perform basic operations against Amazon S3 and compatible services.
<?php
/*
A simple PHP class to perform basic operations against Amazon S3 and compatible
services. Requires modern PHP (7+, probably) with curl, dom, and iconv modules.
Copyright 2022 Marco Arment. Released under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
@marcoarment
marcoarment / Sun.swift
Created January 17, 2021 16:43
Get sunrise, sunset, and the sun's position for a given time and location. Based on NOAA Solar Calculator.
// Sun.swift
// Created by Marco Arment on 1/17/21
//
// Solar-math functions are directly translated from the NOAA Solar Calculator:
// https://www.esrl.noaa.gov/gmd/grad/solcalc/
//
// This is free and unencumbered software released into the public domain.
//
// Anyone is free to copy, modify, publish, use, compile, sell, or
// distribute this software, either in source code form or as a compiled