Skip to content

Instantly share code, notes, and snippets.

View UnderscoreDavidSmith's full-sized avatar

David Smith UnderscoreDavidSmith

View GitHub Profile
@UnderscoreDavidSmith
UnderscoreDavidSmith / gist:8605471
Last active January 4, 2016 09:59
Rough Compilation Speed Comparison
To get a general sense of how fast a machine is for Xcode compilation I use Adium.
It is large and complex enough to tax most machines at least a bit.
My Mid 2012 2.7GHz i7 Retina Mac Book Pro does it in around 1m42s (user + sys) [real ~ 27s].
My Late 2014 4.0GHz i7 Retina iMac does it in around 1m11s (user + sys) [real ~ 18.165s].
-------------------------------
wget https://adiumx.cachefly.net/adium-1.5.9.tgz
/* Automatic Distance Estimation */
"Automatic Distance Estimation" = "Automatique Distance Estimation";
/* "Estimates walked distance automatically, this is typically more accurate than using a fixed stride length."; */
"Distance Explanation" = "Estimations marchaient la distance automatiquement, elle est généralement plus précis que d'utiliser une la longueur de pas fixe.";
@UnderscoreDavidSmith
UnderscoreDavidSmith / generate_personal_podcast.rb
Created August 3, 2016 12:13 — forked from ctaloi/generate_personal_podcast.rb
A script for generating a personal podcast feed from mp3 files in a public Dropbox folder.
#!/usr/bin/env ruby -wKU
#
# by Kelan Champagne
# http://yeahrightkeller.com
#
# A script to generate a personal podcast feed, hosted on Dropbox
#
# Inspired by http://hints.macworld.com/article.php?story=20100421153627718
#
# Simply put this, and some .mp3 or .m4a files in a sub-dir under your Dropbox
@UnderscoreDavidSmith
UnderscoreDavidSmith / txt
Created June 10, 2020 17:40
THIS EPISODE DOES NOT EXIST!
Connected 1: So It’s Not Sandwiches
Connected 2: Songs of Love and War
Connected 3: Million Dollar Challenge
Connected 4: Math, Logic and Humans
Connected 5: The Tale of the Apple I Hate
Connected 6: Region Visibility
Connected 7: Arbitrary Day
Connected 8: Obscure Apple Genius
Connected 9: Galileo of Machines
Connected 10: Insiders
@UnderscoreDavidSmith
UnderscoreDavidSmith / interviews.md
Last active July 19, 2020 17:59
Apple public interviews relating to WWDC 2020
@UnderscoreDavidSmith
UnderscoreDavidSmith / Sparkle.swift
Created December 20, 2022 16:00
Sparkle Effect in SwiftUI
@available(iOS 15.0, *)
struct TwinkleView:View {
private func position(in proxy: GeometryProxy, sparkle:Sparkle) -> CGPoint {
let radius = min(proxy.size.width, proxy.size.height) / 2.0
let drawnRadius = (radius - 5) * sparkle.position.x
let angle = Double.pi * 2.0 * sparkle.position.y
let x = proxy.size.width * 0.5 + drawnRadius * cos(angle)
let y = proxy.size.height * 0.5 + drawnRadius * sin(angle)
@UnderscoreDavidSmith
UnderscoreDavidSmith / UnitSquareIntersectionPoint.swift
Created February 22, 2023 11:59
SwiftUI UnitPoint for Angle
//
// ContentView.swift
// GradientComponenet
//
// Created by David Smith on 2/21/23.
//
import SwiftUI
struct ContentView: View {
@UnderscoreDavidSmith
UnderscoreDavidSmith / scrollview.swift
Created May 23, 2023 15:45
Weird ScrollView bug when backgrounding during .sheet presentation
struct ContentView: View {
@State var presentSheet1:Bool = false
@State var presentSheet2:Bool = false
var body: some View {
ScrollView {
VStack {
Button {
presentSheet1 = true
} label: {
Text("1")
//
// ContentView.swift
// ClockRotationBug
//
// Created by David Smith on 11/6/23.
//
import SwiftUI
struct ContentView: View {