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
# 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 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 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 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) | |
} | |
} |