This file contains hidden or 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
| struct Contact: Decodable, CustomStringConvertible { | |
| var id: String | |
| @NestedKey | |
| var firstname: String | |
| @NestedKey | |
| var lastname: String | |
| @NestedKey | |
| var address: String | |
| enum CodingKeys: String, NestableCodingKey { |
This file contains hidden or 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
| //: ## Demo | |
| struct User: CustomStringConvertible { | |
| let name: String | |
| let age: Int | |
| var description: String { "\(name) (\(age))" } | |
| } | |
| let users = [ | |
| User(name: "Bob", age: 22), |
This file contains hidden or 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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <Bucket | |
| type = "2" | |
| version = "2.0"> | |
| <Breakpoints> | |
| <!-- All Exceptions --> | |
| <BreakpointProxy | |
| BreakpointExtensionID = "Xcode.Breakpoint.ExceptionBreakpoint"> | |
| <BreakpointContent |
This file contains hidden or 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
| #!/usr/bin/env bash | |
| # Build Phase Script for removing NSAppTransportSecurity exceptions from Info.plist | |
| # https://gist.github.com/Ashton-W/07654259322e43a2b6a50bb289e72627 | |
| set -o errexit | |
| set -o nounset | |
| if [[ -z "${REMOVE_ATS_EXCEPTIONS+SET}" ]]; then | |
| echo "error: User Defined Build Setting REMOVE_ATS_EXCEPTIONS must be set" | |
| exit 1 |
This file contains hidden or 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 SwiftUI | |
| struct SubscriptedTextView: View { | |
| // MARK: Properties | |
| let abbreviation: String | |
| var body: some View { | |
| subscriptedText() |
This file contains hidden or 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
| # Call this inside the bin directory of a build of the Swift compiler, | |
| # e.g. build/Xcode-ReleaseAssert/swift-macosx-x86_64/Release/bin. | |
| # | |
| # Adjust the path to match your Xode installation or pick a different binary to dump. | |
| # | |
| # Tested with Xcode 12.0 beta 2. | |
| # | |
| # Note: I used a Swift 5.3 compiler build from a few weeks ago that I had laying around. | |
| # Because of ABI stability, I don't think the swift-reflection-dump version has to match | |
| # the compiler version that was used to build the binary, but I'm not 100% sure. |
This file contains hidden or 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
| query starredRepositories($repositories: Int = 10, $after: String, $releases: Int = 1) { | |
| viewer { | |
| starredRepositories(first: $repositories, after: $after, ownedByViewer: false, orderBy: {field: STARRED_AT, direction: DESC}) { | |
| pageInfo { | |
| hasNextPage | |
| endCursor | |
| } | |
| edges { | |
| cursor | |
| starredAt |
This file contains hidden or 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 dwi3 = DispatchWorkItem { | |
| print("start DispatchWorkItem") | |
| sleep(2) | |
| print("end DispatchWorkItem") | |
| } | |
| //this block will be executed on a the siqpatch queue 'dq' when dwi3 completes | |
| let myDq = DispatchQueue(label: "A custom dispatch queue") | |
| dwi3.notify(queue: myDq) { | |
| print("notify") | |
| } |
This file contains hidden or 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
| # Shamelessly ripped of from https://blog.curtisherbert.com/automated-xcode-build-numbers-early-2019-edition/ | |
| # | |
| git=`sh /etc/profile; which git` | |
| bundleVersion=`"$git" rev-list --all | wc -l | tr -d '[:space:]'` | |
| /usr/libexec/PlistBuddy -c "Set :CFBundleVersion $bundleVersion" "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}" | |
| echo "☛ BUILD NUMBER: ${bundleVersion}" |
This file contains hidden or 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
| // | |
| // AnimatableVector2D.swift | |
| // | |
| // this is derivation of generic AnimatableVector presented at: https://nerdyak.tech/development/2020/01/12/animating-complex-shapes-in-swiftui.html | |
| // | |
| // Created by Pavel Zak on 18/05/2020. | |
| // | |
| import SwiftUI |