- No adverts
- Entries should be age approprate (5-16)
- Be kind
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 | |
// Typesafe UTI, system APIs are all stringly typed 🙄 | |
public struct UTI: CustomDebugStringConvertible, CustomStringConvertible { | |
public enum Error: Swift.Error { | |
case invalidCharachters | |
} | |
private let rawUTI: 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
{ | |
"macOS Dynamic System Colors": { | |
"Alternate selected control text color": { | |
"Use for": "The text on a selected surface in a list or table.", | |
"AppKit API": "alternateSelectedControlTextColor" | |
}, | |
"Alternating content background colors": { | |
"Use for": "The backgrounds of alternating rows or columns in a list, table, or collection view.", | |
"AppKit API": "alternatingContentBackgroundColors" | |
}, |
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
iOS Support Matrix | |
Winter 2012 Edition - v2.0 | |
iPhone June 2007 | |
iPod touch Sept 2007, Feb 2008 (32GB only) | |
iPhone 3G July 2008 | |
iPod touch (2nd Generation) Sept 2008 Sept 2009 - (8GB only) | |
iPhone 3GS June 2009 | |
iPod touch (3rd Generation) Sept 2009 | |
iPad April 2010 | |
iPhone 4 June 2010 |
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 | |
@propertyWrapper | |
public struct RegularExpressionValidation { | |
private var _verifiedString: String? | |
private let _regexPattern: String | |
private lazy var _regex: NSRegularExpression? = try? NSRegularExpression(pattern: _regexPattern, options: [.caseInsensitive]) | |
public init(_ regexString: 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
// | |
// SemanticVersioning.swift | |
// | |
// | |
// Created by Richard Stelling on 28/05/2020. | |
// | |
// The MIT License (MIT) | |
// | |
// Copyright (c) 2016-17 Richard Stelling (http://twitter.com/rjstelling) |
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 | |
public enum StringSearchError: Swift.Error { | |
case didNotFind(Character) | |
} | |
extension String { | |
static let ReducedDigits = "aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ0123456789" | |
static let DefaultBase36 = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" |
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/bash | |
#Usage: $ ./cs_xproj_validate.sh path/to/xcode/project/file/theproject.xcodeproj | |
#More info: http://stackoverflow.com/q/13962341/89035 | |
PROJECT_FILE="$1/project.pbxproj" | |
PREVIOUS_LINE=-1 | |
for LINE in `cat "$PROJECT_FILE" | grep -n CODE_SIGN_IDENTITY | grep -o -E '^([0-9]*)'` |
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
func print<T: FixedWidthInteger>(asBinary val: T) { | |
let bitCount = MemoryLayout<T>.size * 8 | |
let binaryStr = String(val, radix: 2) | |
let zeroPadding = String(repeating: "0", count: bitCount - binaryStr.count) | |
print("0b\(zeroPadding)\(binaryStr)") | |
} |
NewerOlder