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
// | |
// CDView.swift | |
// CD | |
// | |
// Created by Daniel Kuntz on 7/3/23. | |
// | |
import SwiftUI | |
struct ShapeWithHole: Shape { |
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
// | |
// Combine+Pairwise.swift | |
// | |
// Created by Felix Mau on 17.05.21. | |
// Copyright © 2021 Felix Mau. All rights reserved. | |
// | |
import Combine | |
extension Publisher { |
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 SwiftUI | |
extension Calendar { | |
func generateDates( | |
inside interval: DateInterval, | |
matching components: DateComponents | |
) -> [Date] { | |
var dates: [Date] = [] | |
dates.append(interval.start) |
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
cd "${PROJECT_DIR}" | |
# Make sure working directory is clean. | |
if output=$(git status --porcelain) && [ -n "$output" ]; then | |
echo "error: Please commit any uncommitted files before proceeding:\n$output" | |
exit 1 | |
fi | |
# Make sure we are on master (and not a feature branch, for instance) | |
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD) |
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
extension URLSessionConfiguration { | |
@objc | |
static func setupSwizzledSessionConfiguration() { | |
guard self == URLSessionConfiguration.self else { | |
return | |
} | |
let defaultSessionConfiguration = class_getClassMethod(URLSessionConfiguration.self, #selector(getter: URLSessionConfiguration.default)) |
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 | |
CRASH=$1 | |
APP=$2 | |
ARCH=$3 | |
OUTPUT=$4 | |
# This script will fully symbolicate an iOS Crash Report | |
# Usage: ./symbolicate.sh mycrash.crash MyApp.app arch64 output.crash | |
# |
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 { | |
static func randomLightColor() -> UIColor { | |
let halfRange: ClosedRange<CGFloat> = 0.5 ... 1.0 | |
return UIColor( | |
red: CGFloat.random(in: halfRange), | |
green: CGFloat.random(in: halfRange), | |
blue: CGFloat.random(in: halfRange), | |
alpha: 1 |
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 | |
let crayonDictionary = ["Sepia": #colorLiteral(red: 0.6171875, green: 0.35546875, blue: 0.25, alpha: 1.0), | |
"Beaver": #colorLiteral(red: 0.5703125, green: 0.43359375, blue: 0.35546875, alpha: 1.0), | |
"Caribbean Green": #colorLiteral(red: 0.0, green: 0.796875, blue: 0.59765625, alpha: 1.0), | |
"Electric Lime": #colorLiteral(red: 0.796875, green: 0.99609375, blue: 0.0, alpha: 1.0), | |
"Gray": #colorLiteral(red: 0.54296875, green: 0.5234375, blue: 0.5, alpha: 1.0), | |
"Pacific Blue": #colorLiteral(red: 0.0, green: 0.61328125, blue: 0.765625, alpha: 1.0), | |
"Burnt Sienna": #colorLiteral(red: 0.91015625, green: 0.453125, blue: 0.31640625, alpha: 1.0), | |
"Manatee": #colorLiteral(red: 0.55078125, green: 0.5625, blue: 0.62890625, alpha: 1.0), |
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
/* | |
Usage: | |
Adding this script to your doc: | |
- Tools > Script Manager > New | |
- Select "Blank Project", then paste this code in and save. | |
Running the script: | |
- Tools > Script Manager | |
- Select "ConvertToMarkdown" function. | |
- Click Run button. | |
- Converted doc will be mailed to you. Subject will be "[MARKDOWN_MAKER]...". |
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
public struct AttributedString { | |
fileprivate var _handle: NSMutableAttributedString | |
fileprivate init(handle: NSMutableAttributedString) { | |
self._handle = handle | |
} | |
fileprivate init(_ str: NSAttributedString) { | |
self.init(handle: str.mutableCopy() as! NSMutableAttributedString) |
NewerOlder