Skip to content

Instantly share code, notes, and snippets.

💭
Set your status

Klaas klaas

💭
Set your status
Block or report user

Report or block klaas

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View MPMediaItem+MoreProperties.swift
public extension MPMediaItem {
var isLocal: Bool {
return value(forProperty: "isLocal") as! Bool
}
var isTemporaryCloudDownload: Bool {
return value(forProperty: "isTemporaryCloudDownload") as! Bool
}
var isPendingSync: Bool {
View keybase.md

Keybase proof

I hereby claim:

  • I am klaas on github.
  • I am qlaas (https://keybase.io/qlaas) on keybase.
  • I have a public key ASB-YcbrV0Nf8tlERvizDu6PhQHli_z7jt9-EwDKRK0zOwo

To claim this, I am signing this object:

View UIView+Orientation.swift
// Swift version of: https://gist.github.com/smileyborg/a5d1355773ad2ba6bb1e
public enum ViewOrientation {
case Portrait
case Landscape
}
extension UIView {
public class func viewOrientationForSize(size:CGSize) -> ViewOrientation {
return (size.width > size.height) ? .Landscape : .Portrait
View PreferredContentSizeCatogoryToFontPointSize.md

Generated within the iPhone Simulator (iOS Version 8.4 (12H141))

XS S M L XL XXL XXXL Accessibility M AccessibilityL AccessibilityXL AccessibilityXXL AccessibilityXXXL
UIFontTextStyleHeadline 14.0 15.0 16.0 17.0 19.0 21.0 23.0 23.0 23.0 23.0 23.0 23.0
UIFontTextStyleSubheadline 12.0 13.0 14.0 15.0 17.0 19.0 21.0 21.0 21.0 21.0 21.0 21.0
UIFontTextStyleBody 14.0 15.0 16.0 17.0 19.0 21.0 23.0 28.0 33.0 40.0 47.0 53.0
UIFontTextStyleFootnote 12.0 12.0 12.0 13.0 15.0 17.0 19.0 19.0 19.0 19.0 19.0 19.0
UIFontTextStyleCaption1 11.0 11.0 11.0 12.0 14.0 16.0 18.0 18.0 18.0 18.0 18.0 18.0
UIFontTextStyleCaption2 11.0 11.0 11.0 11.0 13.0 15.0 17.0 17.0 17.0 17.0 17.0 17.0
@klaas
klaas / StreamReader.swift
Last active May 21, 2017
Xcode 6.1 version of source for this SO answer http://stackoverflow.com/a/24648951/292145
View StreamReader.swift
import Foundation
class StreamReader {
let encoding : UInt
let chunkSize : Int
var atEof : Bool = false
var fileHandle : NSFileHandle!
let buffer : NSMutableData!
@klaas
klaas / gist:3170952
Created Jul 24, 2012
Open a location in Little Locations and let it be displayed in the create tab
View gist:3170952
// Create location url object
NSURL *url = [NSURL URLWithString:@"littlelocations://create?lat=18.99&lon=72.95&name=Mumbai%20Inner%20Circus"];
// Test if Little Locations is installed
if([[UIApplication sharedApplication] canOpenURL:url] ) {
// Open Location in Little Locations
[[UIApplication sharedApplication] openURL:url];
You can’t perform that action at this time.