Skip to content

Instantly share code, notes, and snippets.

@PadraigK
PadraigK / KeyboardDidShow.swift
Last active February 24, 2024 18:40
Wrapping Notifications for Sendability
// Example of wrapping `UIApplication.keyboardDidShowNotification` payload
struct KeyboardDidShowPayload {
let keyboardFrameBegin: CGRect?
let keyboardFrameEnd: CGRect?
}
extension NotificationWrapper where Payload == KeyboardDidShowPayload {
@MainActor static let keyboardDidShow: Self = .init(
name: UIApplication.keyboardDidShowNotification,
import Foundation
/// KillRing with macOS text text system semantics.
///
/// Use when implementing `yank:` and `yankAndSelect:` actions.
///
/// Learn more at http://hogbaysoftware.com/posts/mac-text-editing-mark-kill-yank/
public class KillRing {
public static let shared = KillRing()

This page is now depreacted!

Check out the repo instead. The Wisdom of Quinn Now with 100% more archived PDFs.

The Wisdom of Quinn

Informative DevForum posts from everyone's favorite DTS member.

(Arranged newest to oldest)

@IsaacXen
IsaacXen / README.md
Last active July 17, 2024 08:21
(Almost) Every WWDC videos download links for aria2c.
@beesandbombs
beesandbombs / sineShine.pde
Created January 21, 2020 01:14
sine shine
int[][] result;
float t, c;
float ease(float p) {
return 3*p*p - 2*p*p*p;
}
float ease(float p, float g) {
if (p < 0.5)
return 0.5 * pow(2*p, g);
@steventroughtonsmith
steventroughtonsmith / UIView+Tooltips.h
Last active December 23, 2023 11:05
WIP tooltips for Mac Catalyst
//
// UIView+Tooltips.h
// Crossword
//
// Created by Steven Troughton-Smith on 13/09/2019.
// Copyright © 2019 Steven Troughton-Smith. All rights reserved.
//
#import <UIKit/UIKit.h>
@marcedwards
marcedwards / circlesofdots.pde
Created June 28, 2019 10:43
Circles of dots in Processing
//
// Circles of dots.
// Created using Processing 3.5.3.
//
// Code by @marcedwards from @bjango.
//
// A GIF of this code can be seen here:
// https://twitter.com/marcedwards/status/1144236924095234053
//
@steventroughtonsmith
steventroughtonsmith / bitcode2intel
Created May 18, 2019 15:31
Converts an ARM64 iOS app with Bitcode into an X86_64 variant
#!/bin/bash
TARGET="$( cd "$(dirname "$1")" ; pwd -P )/$1"
SYSROOT="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk"
TARGET_ARCH=x86_64
export IPHONEOS_DEPLOYMENT_TARGET=12.2
rm -r /tmp/bitcode2intel
mkdir -p /tmp/bitcode2intel
pushd /tmp/bitcode2intel
@eramdam
eramdam / index.js
Created August 12, 2018 20:02
A small script to unfollow non-mutuals on Mastodon (useful if you need to do some cleaning)
const Masto = require('mastodon');
const fs = require('fs')
const M = new Masto({
access_token: 'ACCESS_TOKEN',
api_url: 'https://YOUR-INSTANCE.TLD/api/v1/'
});
function getNextPage(req) {
return (req.headers && req.headers.link && req.headers.link.includes('rel="next"')) ? req.headers.link.split(/<([^>]+)>/)[1] : null;
@smileyborg
smileyborg / InteractiveTransitionCollectionViewDeselection.m
Last active January 15, 2023 13:03
Animate table & collection view deselection alongside interactive transition (for iOS 11 and later)
// UICollectionView Objective-C example
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
NSIndexPath *selectedIndexPath = [[self.collectionView indexPathsForSelectedItems] firstObject];
if (selectedIndexPath != nil) {
id<UIViewControllerTransitionCoordinator> coordinator = self.transitionCoordinator;
if (coordinator != nil) {
[coordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> context) {