Skip to content

Instantly share code, notes, and snippets.

View Bonney's full-sized avatar

Matt Bonney Bonney

View GitHub Profile
@merlinmann
merlinmann / flintstones.md
Created August 23, 2024 00:31
Every day, somebody's born who's never seen "The Flintstones."

Every day, somebody's born who's never seen "The Flintstones."

Cincinnati's independent UHF channel 19 (WXIX, get it?) used to have a "1 O'Clock Movie" that ran for two hours every weekday afternoon. They were mostly old black and white films that, even with all the commercials, often ran shy of the 120-minute block allotted.

When they had to fill the extra time, they'd run a "Questions to the Station Manager" segment, where viewer letters were read and the manager responded on-air. Why'd you stop running Ultraman? (Too violent). Why'd you stop showing pro wrestling? (Too violent). How come you show so many commercials? (Well. We're a business and stuff).

Anyhow. One time a viewer expressed her frustration that WXIX was still showing reruns of The Flintstones, a dumb kid's cartoon that hadn't even been on the air in almost a decade ferchrissakes.

The manager calmly explained that, in addition to lots of kids enjoying the show, you have to keep in mind that, believe it or not, that show is stil

import SwiftUI
import HealthKit
@main
struct HealthkitIntegrationApp: App {
private let healthStore: HKHealthStore
init() {
guard HKHealthStore.isHealthDataAvailable() else { fatalError("This app requires a device that supports HealthKit") }
@EthanLipnik
EthanLipnik / Blur.swift
Last active July 19, 2025 15:26
Blur transition for SwiftUI
//
// Blur.swift
//
//
// Created by Ethan Lipnik on 11/21/22.
//
import SwiftUI
private struct BlurModifier: ViewModifier {
@shaundon
shaundon / MyWidget.swift
Last active August 13, 2024 19:23
Proof of concept of using caches in WidgetKit.
/**
Most of this file has been omitted to only focus on the caching aspect, but in reality
it would be a standard widget template.
**/
struct MyWidgetProvider: IntentTimelineProvider {
// Initialise the cache.
private let cache = MyWidgetCache()
@LukasCZ
LukasCZ / ComplicationController+helpers.swift
Created February 18, 2022 13:41
Helper methods for creating pixel-perfect complications for all Apple Watch sizes.
//
// ComplicationController+helpers.swift
// WatchKit Extension
//
// Created by Lukas Petr on 09.02.2022.
// Distributed under MIT License.
//
//
// Helper methods for creating pixel-perfect complications for all Apple Watch sizes.
@merlinmann
merlinmann / wisdom.md
Last active November 14, 2025 03:16
Merlin's Wisdom Project (Draft)

Merlin's Wisdom Project

Or: “Everybody likes being given a glass of water.”

By Merlin Mann.

It's only advice for you because it had to be advice for me.

@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
import SwiftUI
// Models
enum Lyric {
case line(String)
case pause(TimeInterval)
}
class ScrollToModel: ObservableObject {
@Clarko
Clarko / Frost.swift
Last active December 9, 2021 22:20
SwiftUI live-blur materials
// ⚠️ As of WWDC21 you can just use a SwiftUI Material
// https://developer.apple.com/documentation/swiftui/material
//
// Frost.swift
//
// Created by Clarko on 7/19/20.
//
// A SwiftUI representation of UIVisualEffectView
// and UIBlurEffect, that handles mostly like a
// SwiftUI Color view. Use it as a .background()
import SwiftUI
import PlaygroundSupport
struct ContentView: View {
@State var gradientAngle: Double = 0
var colors = [
Color(UIColor.systemRed),
Color(UIColor.systemOrange),
Color(UIColor.systemYellow),
Color(UIColor.systemGreen),