Skip to content

Instantly share code, notes, and snippets.

View plummer's full-sized avatar

Andrew Plummer plummer

View GitHub Profile
@plummer
plummer / DispatchGroup+Complete.swift
Last active February 1, 2024 08:03
DispatchGroup convenience wrapper for executing a series of blocks concurrently
import Foundation
extension DispatchGroup {
/// Completes a series of blocks and finally executes a completion handler.
///
/// - Parameters:
/// - label: An optional DispatchQueue label (defaults to bg)
/// - qos: An optional DipatchQos (defaults to background)
/// - blocks: The series of blocks to call.
@plummer
plummer / SlideAnimatedTransition.swift
Created September 27, 2018 02:40
A transition that simply slides view controllers, rather than the default `UINavigationController` animation.
import Foundation
import UIKit
/// A transition that simply slides view controllers, rather than the default `UINavigationController` animation.
///
/// Useful for view controller transitions with backgrounds that remain static.
class SlideAnimatedTransition: NSObject, UIViewControllerAnimatedTransitioning {
var direction: Direction = .right
@plummer
plummer / keybase.md
Created December 12, 2017 02:08
keybase.md

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@plummer
plummer / LogoRow.swift
Last active December 30, 2016 08:15
A basic Eureka row for displaying a centred image in a row
//
// LogoRow.swift
//
// Created by Andrew Plummer on 30/12/2016.
//
import Foundation
public protocol LogoCellType {
var logo: UIImageView { get }
function countCSSRules() {
var results = '',
log = '';
if (!document.styleSheets) {
return;
}
for (var i = 0; i < document.styleSheets.length; i++) {
countSheet(document.styleSheets[i]);
}
function countSheet(sheet) {