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
| INFO_PLIST="${TARGET_BUILD_DIR}"/"${INFOPLIST_PATH}" | |
| # Get the GIT hashes | |
| searchOpsApp=$(git rev-parse --short HEAD) | |
| # Query and save the value; suppress any error message, if key not found. | |
| valueApp=$(/usr/libexec/PlistBuddy -c 'print :GitCommitHashApp' "${INFO_PLIST}" 2>/dev/null) | |
| # Check if value is empty | |
| if [ -z "$valueApp" ] |
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 | |
| # This script installs Elasticsearch and Kibana on Amazon Linux 2023 | |
| # It configures the repositories, installs the software, sets it to start on boot, | |
| # and resets the elastic user password for initial access | |
| ## Step 1: Import the Elasticsearch GPG Key for package verification | |
| # This ensures packages are downloaded from a trusted source | |
| rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch |
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
| # Take a screenshot on macOS every minute | |
| # converts the screenshot to webp to reduce file size | |
| while :; | |
| do | |
| name=$(date +%m\-%d\-%y\_%H.%M.%S); | |
| screencapture -m -D 1 -t png ~/Desktop/screenshots/$name.png; | |
| convert ~/Desktop/screenshots/$name.png ~/Desktop/screenshots/$name.webp; | |
| rm -rf ~/Desktop/screenshots/$name.png; | |
| sleep 60; | |
| done |
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
| # Wipe the simulators | |
| xcrun simctl erase all | |
| # Run the unit tests | |
| xcodebuild -scheme TestProject \ | |
| -destination 'platform=iOS Simulator,name=iPhone 15,OS=latest' \ | |
| -resultBundlePath TestResult/ \ | |
| -enableCodeCoverage YES \ | |
| clean build test \ | |
| CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO |
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
| ffmpeg -i ./sim2.mp4 -crf 28 -an simrecording.mp4 |
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
| 'use strict' | |
| import http from "https"; | |
| import zlib from "zlib"; | |
| /* global atob */ | |
| function queryString (kvPairs) { | |
| const result = [] | |
| for (let key in kvPairs) { |
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
| // Swiftui Tricks | |
| // Dimiss multiple sheets | |
| if let firstScene = UIApplication.shared.connectedScenes.first as? UIWindowScene { | |
| if let firstWindow = firstScene.windows.first { | |
| let viewController = firstWindow.rootViewController | |
| viewController?.dismiss(animated: true) | |
| } | |
| } |