Skip to content

Instantly share code, notes, and snippets.

@getaaron
getaaron / irs-get-human.md
Created April 1, 2024 23:01
Get a person at the IRS
  • Call 1-800-829-1040
  • Press 1 for English (or other language as desired)
  • Press 2 for personal tax
  • Press 1 for form / tax history
  • Press 3 for other
  • Press 2 for other
  • Ignore 2 SSN prompts till you get secret other menu
  • Press 2 for personal tax
  • Press 3 for other
  • Wait for agent!
@getaaron
getaaron / macos-messages-subject-field.md
Last active January 1, 2024 06:26
Enable iMessage (Messages) Subject Field in macOS Big Sur through Sonoma

Want the Subject field (for bold iMessages) in macOS’ Messages app?

  1. Quit Messages
  2. Open Terminal
  3. Run defaults write com.apple.MobileSMS MMSShowSubject 1
  4. Start Messages

This worked for me on a fresh install of macOS 14.1.1 (23B81) (new Mac mini).

@getaaron
getaaron / restart-by-tag.sh
Created June 2, 2023 21:02
Restart multiple Kubernetes deployments by tag
# If you want to restart all k8s deployments by label (e.g. where appname=foo, team=bar, and environ=baz), you can
kubectl get deployments --selector=appname=foo,team=bar,environ=baz | tail -n +2 | cut -d ' ' -f 1 | xargs kubectl rollout restart deployment
@getaaron
getaaron / JavaScript Sudoku Solver.js
Last active July 11, 2022 01:15
Solve Sudoku puzzles in O(N²) time
function sudoku(puzzle) {
while (!isSolved(puzzle)) {
for (x = 0; x < 9; x++) {
for (y = 0; y < 9; y++) {
puzzle[y][x] = digit(puzzle, x, y);
}
}
}
return puzzle;
//: Brute force Sudoku solver in Swift
import Foundation
// storage
struct Puzzle {
var array: [[Int]]
}
// accessors and a setter
//: Playground - noun: a place where people can play
import Foundation
// this is either a third party SDK interface or your own analytics client implementation
// that actually sends JSON across the wire to deliver tracked analytics events
protocol AnalyticsClient {
func sendAnalyticsDataToTheBackend(_ eventJSON: [String: Any])
}
#!/bin/bash
for file in ./*.svg
do
rsvg-convert -h 150 "${file}" > "${file%.svg}"@3x.png
rsvg-convert -h 100 "${file}" > "${file%.svg}"@2x.png
rsvg-convert -h 50 "${file}" > "${file%.svg}".png
done
@getaaron
getaaron / Feature Flag.swift
Created December 15, 2017 20:19
Basic feature flags in Swift
//: # Feature Flag example
//: ## Implementation
import Foundation
enum Feature: String {
case Login, AdminTool
var key: String {
@getaaron
getaaron / Podfile
Created October 1, 2017 21:48
Xcode 9 Podfile for supporting both Swift 3.2 and Swift 4 Cocoapods
platform :ios, '9.3'
target 'target-name' do
use_frameworks!
pod 'AFNetworking', '~> 2'
pod 'RSBarcodes_Swift', :git => 'https://github.com/yeahdongcn/RSBarcodes_Swift', :branch => 'master'
swift3 = []
swift4 = ['RSBarcodes_Swift'] # if these pods are in Swift 4
@getaaron
getaaron / Fibonacci.swift
Last active January 29, 2017 21:23
Some implementations of a Fibonacci method in Swift
// The correct numbers
let expectedSequence = [1, 1, 2, 3, 5, 8, 13, 21, 34]
// Iterative
func digit(index: Int) -> Int {
var digits = [1, 1]
for i in (2...index) {