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/bash | |
BREW_PATH="$(which brew)" | |
BREW_PATH_RESULT=$? | |
if [[ $BREW_PATH_RESULT -ne 0 ]] || [[ -z "$BREW_PATH" ]]; then | |
echo "It looks like Homebrew is not already installed." | |
echo "Finding path where it will be..." | |
arch="$(arch)" # -i is only linux, -m is linux and apple | |
if [[ "$arch" = i386 ]]; then |
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/bash | |
tmpfile=$(mktemp) | |
branch=${1:-main} | |
logfileslst=$(mktemp) | |
echo -n "Compiling list of changes..." | |
git diff --name-only $1 HEAD | while read -r file; do | |
logfile=$(mktemp) |
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
// swift-tools-version: 5.9 | |
// The swift-tools-version declares the minimum version of Swift required to build this package. | |
// add this to beginning of your Package.swift | |
import PackageDescription | |
// MARK: SupportedPlatform | |
protocol SupportedPlatformable { |
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
// | |
// NSWindowAdaptorModifier.swift | |
// Copyright (c) 2023 BrightDigit. | |
// | |
import AppKit | |
import Foundation | |
import SwiftUI | |
// swiftlint:disable strict_fileprivate |
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 AppKit | |
import SwiftUI | |
// .onCloseButton(self.$object.delegate, { _ in | |
// self.object.presentConfirmCloseAlert = true | |
// return false | |
// }) | |
class NSWindowDelegateAdaptor: NSObject, NSWindowDelegate { | |
internal init(onWindowShouldClose: ((NSWindow) -> Bool)?) { |
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
// | |
// PreferredLayoutView.swift | |
// Copyright (c) 2023 BrightDigit. | |
// | |
#if canImport(SwiftUI) | |
import Foundation | |
import SwiftUI | |
public struct Value<Value> { |
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
// | |
// FileManager+ReduceDirectory.swift | |
// Copyright (c) 2023 BrightDigit. | |
// | |
import Foundation | |
private extension Error where Self == NSError { | |
static func fileNotFound(at url: URL) -> NSError { | |
NSError( |
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/bash | |
SOURCE_DIR="/path/to/your/source/directory" | |
find "$SOURCE_DIR" -name "*.swift" -type f -print0 | while IFS= read -r -d '' file; do | |
# Create a temporary file for editing | |
tmp_file=$(mktemp) | |
# Use awk to perform the replacement and save to the temporary file | |
awk ' |
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/bash | |
# Check if input file is provided | |
if [ $# -ne 1 ]; then | |
echo "Usage: $0 <input_file.swift>" | |
exit 1 | |
fi | |
input_file="$1" | |
output_file="${input_file%.swift}_cleaned.swift" |
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/bash | |
# Define Swift Package Dependencies | |
dependencies=( | |
"Vapor:https://github.com/vapor/vapor.git:4.66.0" | |
"Fluent:https://github.com/vapor/fluent.git:4.0.0" | |
"FluentPostgresDriver:https://github.com/vapor/fluent-postgres-driver.git:2.0.0" | |
"JWT:https://github.com/vapor/jwt.git:5.0.0-beta.1" | |
"AsyncAlgorithms:https://github.com/apple/swift-async-algorithms:1.0.0" | |
"OpenAPIVapor:https://github.com/swift-server/swift-openapi-vapor:1.0.0" |