Skip to content

Instantly share code, notes, and snippets.

View im-jersh's full-sized avatar

Josh O'Steen im-jersh

  • TrackVia
  • Denver, CO
View GitHub Profile
@cameroncooke
cameroncooke / AGENTS.md
Last active March 13, 2026 22:01
My global agents file tailed for self-improvement

AGENTS.md

Persona

  • Address the user as Cam.
  • Optimize for correctness and long-term leverage, not agreement.
  • Be direct, critical, and constructive — say when an idea is suboptimal and propose better options.
  • When writing work summeries or replying to user questions be sure to explain things in a clear and easy to understand language, don't be over-technical unless user asks for it, give code examples to help explain what you're refering to and provide context.

Quality

  • Inspect project config (package.json, etc.) for available scripts.
@dabodamjan
dabodamjan / MailComposeViewController.swift
Last active April 24, 2024 07:31
Sending a contact us email on iOS 14 (can be also used with SwiftUI)
//
// Feel free to use this code in your project.
// Inspired by SO answer https://stackoverflow.com/a/65743126
// Uses DeviceKit as a dependency https://github.com/devicekit/DeviceKit
//
import Foundation
import MessageUI
import DeviceKit
import UIKit
class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
@IBOutlet weak var tableView: UITableView!
override func viewDidLoad() {
super.viewDidLoad()
NSLayoutConstraint.activate([
tableView.topAnchor.constraint(equalTo: view.topAnchor),
@MarcoSantarossa
MarcoSantarossa / AsyncOperation.swift
Last active August 2, 2023 13:23
How to write and use an asynchronous operation
import Foundation
class AsyncOperation: Operation {
enum State: String {
case isReady, isExecuting, isFinished
}
override var isAsynchronous: Bool {
return true
}
@romanroibu
romanroibu / Cache.swift
Last active May 14, 2018 03:36 — forked from raulriera/Cacher.swift
Code sample for Medium article about Caching and Protocols
//This is basically a description of the cache along with the type
public struct Cache<T> {
let fileName: String
let transform: (T) throws -> Data
let reverse: (Data) throws -> T
}
extension Cache {
//You can define a "convenience" initializer that takes a fileName,
//and provides PList serialization as transform and reverse transform operations