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 UIKit | |
extension UIFont { | |
public func withMonospacedNumbers() -> Self { | |
let monospacedFeature: [UIFontDescriptor.FeatureKey: Any] | |
if #available(iOS 15.0, *) { | |
monospacedFeature = [ | |
.type: kNumberSpacingType, | |
.selector: kMonospacedNumbersSelector |
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 Darwin.TargetConditionals; | |
#if TARGET_OS_IPHONE | |
@import UIKit; | |
#else | |
@import AppKit; | |
#endif | |
/// Concrete text storage intended to be subclassed. | |
@interface BaseTextStorage : NSTextStorage |
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 UIKit | |
/// Fast, concrete text storage intended to be subclassed. | |
class BaseTextStorage: NSTextStorage { | |
// MARK: - Properties | |
private let storage = NSMutableAttributedString() | |
// MARK: - NSTextStorage |
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
// | |
// GPUImageTextureInput+CIImage.h | |
// GPUImage | |
// | |
// Created by Sam Soffes on 3/4/14. | |
// Copyright (c) 2014 Sam Soffes. All rights reserved. | |
// | |
#import "GPUImageTextureInput.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
TEAM_ID = 'XXXXXXXXXX' | |
APP_NAME = 'My App' | |
SCHEME_NAME = APP_NAME | |
desc 'Create a beta build' | |
task :build do | |
# Ensure clean git state | |
unless system 'git diff-index --quiet HEAD --' | |
abort 'Failed. You have uncommitted changes.' | |
end |
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 Foundation | |
import Security | |
struct SharedWebCredentials { | |
// MARK: - Types | |
struct Credential { | |
let domain: String | |
let account: String |
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 UIKit | |
final class SafariActivity: UIActivity { | |
// MARK: - Properties | |
var url: URL? | |
// MARK: - UIActivity |
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
{ | |
"bold_folder_labels": true, | |
"color_scheme": "Packages/User/Espresso Soda.tmTheme", | |
"ensure_newline_at_eof_on_save": true, | |
"file_exclude_patterns": | |
[ | |
".DS_Store", | |
".gitkeep", | |
"dump.rdb" | |
], |
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 UIKit | |
extension UIColor { | |
var luminance: CGFloat { | |
var red: CGFloat = 0 | |
var green: CGFloat = 0 | |
var blue: CGFloat = 0 | |
getRed(&red, green: &green, blue: &blue, alpha: nil) |
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
// Taken from: | |
// https://gist.github.com/joelcox/28de2f0cb21ea47bd789 | |
NSColor.selectedMenuItemColor.set() | |
NSBezierPath(rect: rect).fill() | |
if rect.height > 1 { | |
let currentControlTint = NSColor.currentControlTint | |
let startingAlpha: CGFloat = currentControlTint == .blueControlTint ? 0.16 : 0.09 |