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
# PDF to PNG shell script for Quickdrop app | |
# https://quickdrop.antran.app/ | |
# pdfburst shell script | |
# chmod 0755 pdfburst | |
#!/usr/bin/swift | |
import Foundation | |
import PDFKit |
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 | |
public struct UniformWindowGroup<Content: View>: Scene { | |
var id: String? | |
var maxWidth: CGFloat | |
var maxHeight: CGFloat | |
var aspectRatio: CGFloat | |
var content: Content | |
@State private var setSize: CGSize? |
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 | |
import UniformTypeIdentifiers | |
struct FileDragProvider: NSViewRepresentable { | |
var filePromise: FilePromise | |
var preview: PlatformImage | |
class NSViewType: NSView, NSFilePromiseProviderDelegate, NSDraggingSource { | |
var filePromise: FilePromise | |
var preview: PlatformImage |
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 | |
# https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_use_of_required_reason_api | |
searchTerms=( | |
# File timestamp APIs | |
"creationDate" | |
"modificationDate" | |
"fileModificationDate" | |
"contentModificationDateKey" | |
"creationDateKey" |
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
// | |
// ThreadSafe.swift | |
// GDICore | |
// | |
// Created by Grant Davis on 1/2/21. | |
// Updated to support `_modify` accessor on 12/5/21. | |
// | |
// Copyright © 2021 Grant Davis Interactive, LLC. All rights reserved. | |
// | |
import Foundation |
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
JSON: | |
https://unpkg.com/[email protected]/emoji.json | |
class EmojiManager: ObservableObject { | |
@Published var emojis: [EmojiObject] = [] | |
init() { | |
decodeJSON() |
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 | |
enum TrigonometricFunction: CaseIterable { | |
case sinus | |
case cosinus | |
func apply(_ value: Double) -> Double { | |
switch self { | |
case .cosinus: | |
return cos(value) |
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/zsh | |
makeXCFramework () { | |
BASEDIR=$(pwd) | |
echo "Script location: ${BASEDIR}" | |
LIBNAME=$(basename $BASEDIR) | |
echo "lib is: $LIBNAME" | |
cd Frameworks |
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
// Don't forget to add to the project: | |
// 1. DeepLabV3 - https://developer.apple.com/machine-learning/models/ | |
// 2. CoreMLHelpers - https://github.com/hollance/CoreMLHelpers | |
enum RemoveBackroundResult { | |
case background | |
case finalImage | |
} | |
extension UIImage { |
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
# Record screen from simulator: | |
xcrun simctl io booted recordVideo appVideo.mov | |
# Full size screen recording | |
ffmpeg -i screen-recording.mp4 -i iPhone12ProOverlay.png \ | |
-filter_complex "scale=-1:2532,pad=width=3656:height=2057:x=(ow-iw)/2:y=(oh-ih)/2,overlay=x=0:y=0" \ | |
output.mp4 | |
# Screen recording resized to 1920px height | |
ffmpeg -i screen-recording.mp4 -i iPhone12ProOverlay-3656.png \ |
NewerOlder