Check out the repo instead. The Wisdom of Quinn Now with 100% more archived PDFs.
Informative DevForum posts from everyone's favorite DTS member.
(Arranged newest to oldest)
// 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() |
Check out the repo instead. The Wisdom of Quinn Now with 100% more archived PDFs.
Informative DevForum posts from everyone's favorite DTS member.
(Arranged newest to oldest)
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); |
// | |
// 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> |
// | |
// 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 | |
// |
#!/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 |
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; |
// 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) { |