Skip to content

Instantly share code, notes, and snippets.

@tcldr
tcldr / TimingFunction.swift
Last active March 21, 2023 07:24
For when you need the progress along an Apple Animation curve outside of CoreAnimation in a Swift 4.2 interface. Given a cubic Bezier timing curve defined by two control points, (or UIKit's `UICubicTimingParameters`), returns the progress along the curve at any given time. Includes a port of the WebKit implementation of UnitBezier which hopefull…
//
// TimingFunction.swift
//
// Created by tcldr on 04/11/2018.
// https://github.com/tcldr
// Copyright © 2018 tcldr.
//
// Permission is hereby granted, free of charge,
// to any person obtaining a copy of this software and
// associated documentation files (the "Software"), to
@focus97
focus97 / hack-your-own-slack-theme.md
Last active April 13, 2023 17:07
How to theme Slack (Dark, Solarized, White, Rosé, whatever)

How to theme Slack v4.12.0+

Update as of 8.08.2021:

  • Hid the bookmarks bar and fine-tuned some header styles.

If you want to add your own style to Slack, here's how.

My quazi-Tron Theme'ish?

I dunno what happened. I just wanted to try something sporty/future-y, I guess. Code for this is directly below.

@mbehan
mbehan / ForcePanGestureRecognizer.swift
Created November 11, 2016 23:11
A UIPanGestureRecognizer subclass to get the force of the gesture's touch (assumes a single touch)
import UIKit.UIGestureRecognizerSubclass
class ForcePanGestureRecognizer : UIPanGestureRecognizer {
private(set) var force = CGFloat(0) {
didSet {
if force > maxForce {
maxForce = force
}
}
@floriankugler
floriankugler / gist:6870499
Last active September 29, 2023 15:56
Mapping of NSURLConnection to NSURLSession delegate methods. Created by Mattt Thompson.
NSURLConnection | NSURLSession
------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------
NSURLConnectionDelegate connectionShouldUseCredentialStorage: |
------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------
NSURLConnectionDelegate connection:willSendRequestForAuthenticationChallenge: | NSURLSessionDelegate URLSession:didReceiveChallenge:completionHandler:
| N