Skip to content

Instantly share code, notes, and snippets.

View regularberry's full-sized avatar

Sean Berry regularberry

View GitHub Profile
let quantity = CLSQuantityItem(identifier: "Score", title: "Score")
quantity.quantity = Double(score)
CLSDataStore.shared.mainAppContext.descendant(matchingIdentifierPath: identifierPath) { context, _ in
guard let activity = context?.currentActivity else { return }
activity.primaryActivityItem = quantity
CLSDataStore.shared.save()
}
import UIKit
class MiddleView: UIView {
let titleLabel: UILabel = {
let label = UILabel()
label.font = .systemFont(ofSize: 20.0)
label.translatesAutoresizingMaskIntoConstraints = false
label.numberOfLines = 1
label.textAlignment = .left
label.text = "MIDDLE TITLE"
import SwiftUI
struct ContentView: View {
let backgroundGray = Color(
red: 0,
green: 0,
blue: 0,
opacity: 0.25
)
@regularberry
regularberry / setup-script.sh
Last active May 24, 2025 19:04
Setup Script for OpenAI's codex to get SwiftLint running
#!/usr/bin/env bash
set -euxo pipefail
SWIFTLINT_VERSION="0.59.1"
ZIP_URL="https://github.com/realm/SwiftLint/releases/download/${SWIFTLINT_VERSION}/SwiftLintBinary.artifactbundle.zip"
curl -L -o /tmp/swiftlint.zip "$ZIP_URL"
unzip -q /tmp/swiftlint.zip -d /tmp/swiftlint_bundle
# choose the right variant for the host OS