This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// TTMArithmetic.m | |
// | |
// Copyright (c) 2015 Shuichi Tsutsumi. All rights reserved. | |
// | |
#import "TTMArithmetic.h" | |
@import Accelerate; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Async.swift | |
// | |
// Created by Tobias DM on 15/07/14. | |
// | |
// OS X 10.10+ and iOS 8.0+ | |
// Only use with ARC | |
// | |
// The MIT License (MIT) | |
// Copyright (c) 2014 Tobias Due Munk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <objc/runtime.h> | |
@implementation ClassList | |
+ (NSArray*)subclassesOfClass:(Class)parentClass | |
{ | |
int numClasses = objc_getClassList(NULL, 0); | |
Class *classes = (Class*)malloc(sizeof(Class) * numClasses); | |
numClasses = objc_getClassList(classes, numClasses); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@IBDesignable | |
class TextField: UITextField { | |
@IBInspectable var insetX: CGFloat = 0 | |
@IBInspectable var insetY: CGFloat = 0 | |
// placeholder position | |
override func textRectForBounds(bounds: CGRect) -> CGRect { | |
return CGRectInset(bounds , insetX , insetY) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let username = organizer.twitter | |
let twitterURLs = [ | |
"twitter://user?screen_name=\(username)", // Twitter | |
"tweetbot://user_profile/\(username)", // TweetBot | |
"echofon://user_timeline?\(username)", // Echofon | |
"twit://user?screen_name=\(username)", // Twittelator Pro | |
"x-seesmic://twitter_profile?twitter_screen_name=\(username)", // Seesmic | |
"x-birdfeed://user?screen_name=\(username)", // Birdfeed | |
"tweetings://user?screen_name=\(username)", // Tweetings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public struct Async { | |
// MARK: - Private properties and init | |
/** | |
Private property to hold internally on to a `dispatch_block_t` | |
*/ | |
private let block: dispatch_block_t | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* libMobileGestalt header. | |
* Mobile gestalt functions as a QA system. You ask it a question, and it gives you the answer! :) | |
* | |
* Copyright (c) 2013-2014 Cykey (David Murray) | |
* All rights reserved. | |
*/ | |
#ifndef LIBMOBILEGESTALT_H_ | |
#define LIBMOBILEGESTALT_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal | |
# make sure the output directory exists | |
mkdir -p "${UNIVERSAL_OUTPUTFOLDER}" | |
# Step 1. Build Device and Simulator versions | |
xcodebuild -target "${PROJECT_NAME}" ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphoneos BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build | |
xcodebuild -target "${PROJECT_NAME}" -configuration ${CONFIGURATION} -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Modified from: https://github.com/katleta3000/CancelBlocks/blob/master/CancelBlocks.swift | |
typealias dispatch_cancelable_block_t = (cancel: Bool) -> (Void) | |
private func dispatch_after_delay(delay: Double, queue: dispatch_queue_t, block: dispatch_block_t?) -> dispatch_cancelable_block_t? { | |
guard let block = block else { return nil } | |
var originalBlock: dispatch_block_t? = block | |
var cancelableBlock: dispatch_cancelable_block_t? = nil | |
let delayBlock: dispatch_cancelable_block_t = {(cancel: Bool) -> Void in | |
if let originalBlock = originalBlock where !cancel { |
OlderNewer