Skip to content

Instantly share code, notes, and snippets.

View wooster's full-sized avatar

Andrew Wooster wooster

View GitHub Profile
import UIKit
class FloatingButtonController: UIViewController {
private(set) var button: UIButton!
required init?(coder aDecoder: NSCoder) {
fatalError()
}
@mackuba
mackuba / wwdc15.md
Last active August 6, 2022 17:28
New stuff from WWDC 2015

Here's my own list of the interesting stuff announced during this year's WWDC, collected from the keynotes, various Apple docs, blog posts and tweets.

If you're planning to watch the videos, I really recommend this Mac app that helps you download and watch them: https://github.com/insidegui/WWDC.

OS X El Capitan

http://www.apple.com/osx/elcapitan-preview/

  • split view - two apps side by side on full screen
@jspahrsummers
jspahrsummers / GHRunLoopWatchdog.h
Created January 28, 2015 20:50
A class for logging excessive blocking on the main thread
/// Observes a run loop to detect any stalling or blocking that occurs.
///
/// This class is thread-safe.
@interface GHRunLoopWatchdog : NSObject
/// Initializes the receiver to watch the specified run loop, using a default
/// stalling threshold.
- (id)initWithRunLoop:(CFRunLoopRef)runLoop;
/// Initializes the receiver to detect when the specified run loop blocks for
//
// NSObject+KVOWeakPropertyDebug.h
// KVOWeakPropertyDebug
//
// Created by Vladimir Grichina on 12.01.13.
// Copyright (c) 2013 Vladimir Grichina. All rights reserved.
//
#import <Foundation/Foundation.h>
@landonf
landonf / xcode-gripes.md
Last active August 21, 2020 09:06
Every time I hit something that annoys me in Xcode, I add the feature/UX improvement/change I'd like to the list.

Xcode Wish List:

Legacy Support

  • Additional optional downloads:
    • Older SDKs, eg, for building ancient projects.
    • Older compilers (for same).
  • Either ship gcc/llvm-gcc or don't. Don't ship clang and call it 'gcc', that just breaks anyone who actually needs GCC and finds your not-gcc in the PATH.

UX

Project/File Navigation

@debasishg
debasishg / gist:8172796
Last active May 10, 2024 13:37
A collection of links for streaming algorithms and data structures

General Background and Overview

  1. Probabilistic Data Structures for Web Analytics and Data Mining : A great overview of the space of probabilistic data structures and how they are used in approximation algorithm implementation.
  2. Models and Issues in Data Stream Systems
  3. Philippe Flajolet’s contribution to streaming algorithms : A presentation by Jérémie Lumbroso that visits some of the hostorical perspectives and how it all began with Flajolet
  4. Approximate Frequency Counts over Data Streams by Gurmeet Singh Manku & Rajeev Motwani : One of the early papers on the subject.
  5. [Methods for Finding Frequent Items in Data Streams](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.187.9800&amp;rep=rep1&amp;t
@kongtomorrow
kongtomorrow / gist:6803313
Created October 3, 2013 01:37
compile-time generation of compile-time checked KVC key paths
#import <Foundation/Foundation.h>
#define KVCKeyPath_1(a) @"" a
#define KVCKeyPath_2(a, ...) a @"." KVCKeyPath_1(__VA_ARGS__)
#define KVCKeyPath_3(a, ...) a @"." KVCKeyPath_2(__VA_ARGS__)
#define KVCKeyPath_4(a, ...) a @"." KVCKeyPath_3(__VA_ARGS__)
#define KVCKeyPath_5(a, ...) a @"." KVCKeyPath_4(__VA_ARGS__)
#define KVCKeyPath_6(a, ...) a @"." KVCKeyPath_5(__VA_ARGS__)
#define KVCKeyPath_7(a, ...) a @"." KVCKeyPath_6(__VA_ARGS__)
@sneakyness
sneakyness / gist:6644441
Created September 20, 2013 21:54
crunchitize me, captain!!!!
// insert in viewDidLoad for fun wobbly time
UIInterpolatingMotionEffect *mxx = [[UIInterpolatingMotionEffect alloc] initWithKeyPath:@"layer.transform.rotation.y" type:UIInterpolatingMotionEffectTypeTiltAlongHorizontalAxis];
mxx.maximumRelativeValue = @-0.75;
mxx.minimumRelativeValue = @0.75;
UIInterpolatingMotionEffect *mxy = [[UIInterpolatingMotionEffect alloc] initWithKeyPath:@"layer.transform.rotation.x" type:UIInterpolatingMotionEffectTypeTiltAlongVerticalAxis];
mxy.maximumRelativeValue = @-0.75;
mxy.minimumRelativeValue = @0.75;

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style

@steipete
steipete / PSPDFUIKitMainThreadGuard.m
Last active March 10, 2024 19:23
This is a guard that tracks down UIKit access on threads other than main. This snippet is taken from the commercial iOS PDF framework http://pspdfkit.com, but relicensed under MIT. Works because a lot of calls internally call setNeedsDisplay or setNeedsLayout. Won't catch everything, but it's very lightweight and usually does the job.You might n…
// Taken from the commercial iOS PDF framework http://pspdfkit.com.
// Copyright (c) 2014 Peter Steinberger, PSPDFKit GmbH. All rights reserved.
// Licensed under MIT (http://opensource.org/licenses/MIT)
//
// You should only use this in debug builds. It doesn't use private API, but I wouldn't ship it.
// PLEASE DUPE rdar://27192338 (https://openradar.appspot.com/27192338) if you would like to see this in UIKit.
#import <objc/runtime.h>
#import <objc/message.h>