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 use in Xcode | |
# Copy Resources based on Configuration | |
# | |
# https://gist.github.com/Ashton-W/a47ec8b128ecbe470632 | |
set -o nounset | |
# From Build Environment |
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
#!/bin/sh | |
# make sure you have imagemagick installed: brew install imagemagick | |
# your app_icons.sh file should have the correct permissions: run `chmod 775 app_icons.sh` in your terminal from where you put this file | |
# put your `my_icon.png` next to this file and run ./app_icons.sh to export your app icons | |
x=my_icon.png | |
y=${x%.*} | |
# delete the export directory so we start clean |
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
OVERVIEW: Swift compiler | |
USAGE: swiftc [options] <inputs> | |
MODES: | |
-dump-ast Parse and type-check input file(s) and dump AST(s) | |
-dump-parse Parse input file(s) and dump AST(s) | |
-dump-scope-maps <expanded-or-list-of-line:column> | |
Parse and type-check input file(s) and dump the scope map(s) | |
-dump-type-refinement-contexts |
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 |
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
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
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
import Foundation | |
import Combine | |
// MARK: - ClueElement | |
struct ClueElement: Codable { | |
let id: Int | |
let answer, question: String | |
let value: Int | |
let categoryID: Int | |
let category: Category |
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
import SwiftUI | |
struct SubscriptedTextView: View { | |
// MARK: Properties | |
let abbreviation: String | |
var body: some View { | |
subscriptedText() |