#Every Single Option Under The Sun
- optimization level options
- automatic crashing options
- debug info options
- swift internal options
- swift debug/development internal options
- linker-specific options
- mode options
import Foundation | |
class Box<T> { | |
let unbox: T | |
init(_ value: T) { self.unbox = value } | |
} | |
struct Notification<A> { | |
let name: String | |
} |
// To unzip the epub, move the ePub to a folder, cd to it then simply: | |
unzip MyEbook.epub | |
// To zip up an epub: | |
1. zip -X MyNewEbook.epub mimetype | |
2. zip -rg MyNewEbook.epub META-INF -x \*.DS_Store | |
3. zip -rg MyNewEbook.epub OEBPS -x \*.DS_Store | |
Some explanations necessary here. We start each line with two flags: |
#Every Single Option Under The Sun
#!/usr/bin/perl | |
# This filter changes all words to Title Caps, and attempts to be clever | |
# about *un*capitalizing small words like a/an/the in the input. | |
# | |
# The list of "small words" which are not capped comes from | |
# the New York Times Manual of Style, plus 'vs' and 'v'. | |
# | |
# 10 May 2008 | |
# Original version by John Gruber: |
// Based on Swift 1.2, ObjectMapper 0.15, RealmSwift 0.94.1 | |
// Author: Timo Wälisch <[email protected]> | |
import UIKit | |
import RealmSwift | |
import ObjectMapper | |
import SwiftyJSON | |
class ArrayTransform<T:RealmSwift.Object where T:Mappable> : TransformType { | |
typealias Object = List<T> |
// | |
// ViewController.swift | |
// KeyboardTest | |
// | |
// Created by Adam Śliwakowski on 01.12.2015. | |
// Copyright © 2015 Adam Śliwakowski. All rights reserved. | |
// | |
import UIKit | |
typealias AnimationClosure = (() -> Void) |
xattr -d com.apple.quarantine /path/to/app/myMacApp.app |
import UIKit | |
extension UIImage { | |
// colorize image with given tint color | |
// this is similar to Photoshop's "Color" layer blend mode | |
// this is perfect for non-greyscale source images, and images that have both highlights and shadows that should be preserved | |
// white will stay white and black will stay black as the lightness of the image is preserved | |
func tint(tintColor: UIColor) -> UIImage { | |
import Foundation | |
import XCPlayground | |
XCPlaygroundPage.currentPage.needsIndefiniteExecution = true | |
extension NSData { | |
func castToCPointer<T>() -> T { | |
let mem = UnsafeMutablePointer<T>.alloc(sizeof(T.Type)) | |
self.getBytes(mem, length: sizeof(T.Type)) | |
return mem.move() |