- Create or find a gist that you own.
- Clone your gist (replace
<hash>with your gist's hash):# with ssh git clone git@gist.github.com:<hash>.git mygist # with https
git clone https://gist.github.com/.git mygist
| import Foundation | |
| import PlaygroundSupport | |
| /// A thread-safe array. | |
| public class SynchronizedArray<Element> { | |
| private let queue = DispatchQueue(label: "io.zamzam.ZamzamKit.SynchronizedArray", attributes: .concurrent) | |
| private var array = [Element]() | |
| public init() { } | |
| localeIdentifier | Description | |
|---|---|---|
| eu | Basque | |
| hr_BA | Croatian (Bosnia & Herzegovina) | |
| en_CM | English (Cameroon) | |
| en_BI | English (Burundi) | |
| rw_RW | Kinyarwanda (Rwanda) | |
| ast | Asturian | |
| en_SZ | English (Swaziland) | |
| he_IL | Hebrew (Israel) | |
| ar | Arabic |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <!-- iOS 10, macOS Sierra, and friends bring a new logging subsystem that's | |
| supposed to scale from the kernel, up to frameworks, and up to apps. It defaults | |
| to a more regimented, privacy-focused approach that large apps and complex | |
| systems need. | |
| It, along with Activity Tracing introduced in iOS 8 and macOS Yosemite and the | |
| Console app in macOS Sierra, hope to help you graduate from caveman debugging to |
| // | |
| // Activity.swift | |
| // | |
| // Created by Zachary Waldowski on 8/21/16. | |
| // Copyright © 2016 Zachary Waldowski. Licensed under MIT. | |
| // | |
| import os.activity | |
| private final class LegacyActivityContext { |
| import UIKit | |
| class NRLabel : UILabel { | |
| var textInsets = UIEdgeInsets.zero { | |
| didSet { invalidateIntrinsicContentSize() } | |
| } | |
| override func textRect(forBounds bounds: CGRect, limitedToNumberOfLines numberOfLines: Int) -> CGRect { | |
| let insetRect = UIEdgeInsetsInsetRect(bounds, textInsets) |
<hash> with your gist's hash):
# with ssh
git clone git@gist.github.com:<hash>.git mygist
# with httpsgit clone https://gist.github.com/.git mygist
Here's a step-by-step guide on how to get these painful things working properly in Xcode 7.3 on OS X 10.11 El Capitan.
NSCollectionView object into an existing storyboard or standalone nib.NSCollectionView, and in the inspector, change Layout from Content Array (Legacy) to Flow.NSCollectionViewItem subclass to the project, naming it something like MyCollectionViewItem.| import Foundation | |
| import CocoaLumberjack | |
| import Crashlytics | |
| class CrashlyticsLogger : DDAbstractLogger | |
| { | |
| static let sharedInstance = CrashlyticsLogger() | |
| private var _logFormatter : DDLogFormatter? | |
| override var logFormatter: DDLogFormatter? { |
Friend: I tried looking at static linking in Mac OS X and it seems nearly impossible. Take a look at this http://stackoverflow.com/a/3801032
Me: I have no idea what that
-staticflag does, but I'm pretty sure that's not how you link to a library. Let me RTFM a bit.
Minutes later...
| import Foundation | |
| public protocol ServiceLocatorModul { | |
| func registerServices(serviceLocator: ServiceLocator) | |
| } | |
| public class ServiceLocator { | |
| private var registry = [ObjectIdentifier:Any]() | |
| public static var sharedLocator = ServiceLocator() |