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
/* | |
* filesize.m | |
* Description: Multiple ways to calculate the size of a file's resource fork | |
* Author: Chad Armstrong | |
* Date: 14 April 2018 (Updated 28 October 2022) | |
* To compile: gcc -w -framework Cocoa filesize.m -o filesize | |
* To run: ./filesize path/to/file | |
*/ | |
/* References: |
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
ls *.tif | xargs sips -s format tiff -s formatOptions lzw |
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
-- CountOpenChromeTabs.scpt | |
-- Author: Chad Armstrong | |
-- Date: 30 August 2019 | |
-- Description: Count the number of open tabs in Google Chrome | |
-- To run from CLI: osascript CountOpenChromeTabs.scpt | |
-- To create an alias command: | |
-- In ~/.bash_profile, add the line: alias counttabs='osascript ~/Projects/Scripts/CountOpenChromeTabs.scpt' | |
-- Refresh the bash shell environment: source ~/.bash_profile | |
tell application "Google Chrome" |
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
-- QFG5 Mac OS 9 Installer | |
-- Author: Chad Armstrong (chad@edenwaith.com) | |
-- Version History: | |
-- • Version 1.1 (April - May 2022) | |
-- • Version 1.0 (8 October 2001) | |
tell application "Finder" | |
set startupDisk to (name of startup disk) | |
set applicationsFolder to startupDisk & ":Applications:" |
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
#!/usr/bin/swift | |
import Foundation | |
/* | |
* rle.swift | |
* | |
* Author: Chad Armstrong | |
* Date: 21 July 2018 | |
* Description: Example of encoding a string using Run Length Encoding | |
* Example: The string aabbbaaaac will be encoded as 2a3b4a1c |
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/sh | |
# make-android-icons.sh | |
# Author: Chad Armstrong | |
# Date: 11 December 2020 | |
# Description: Take an image and output to various Android resolutions (ldpi - xxxhdpi) | |
# This script runs under macOS and requires ImageMagick to be installed. | |
# Need ImageMagick first |
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
-- File: CreateAccessibilityInspectorAlias.scpt | |
-- Description: Create an alias in the Applications folder which points to the | |
-- Accessibility Inspector.app contained within Xcode. | |
-- Author: Chad Armstrong (chad@edenwaith.com) | |
-- Date: 8 December 2021 | |
tell application "Finder" | |
set destinationFolder to "Macintosh HD:Applications" | |
set sourceApplication to "Macintosh HD:Applications:Xcode.app:Contents:Applications:Accessibility Inspector.app" | |
make new alias file at destinationFolder to sourceApplication | |
end tell |
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
/* | |
* freesize.m | |
* Description: Multiple ways to calculate the free space on the root volume | |
* Blog post: http://www.edenwaith.com/blog/index.php?p=67 | |
* Author: Chad Armstrong | |
* Date: 6 - 10 May 2017, 25 August 2021 | |
* To compile: gcc -framework Foundation freesize.m -o freesize | |
* To run: ./freesize | |
*/ |
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
# xcode-build-bump.sh | |
# @desc Auto-increment the build number every time the project is run. | |
# @usage | |
# 1. Select: your Target in Xcode | |
# 2. Select: Build Phases Tab | |
# 3. Select: Add Build Phase -> Add Run Script | |
# 4. Paste code below in to new "Run Script" section | |
# 5. Drag the "Run Script" below "Link Binaries With Libraries" | |
# 6. Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 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
/* | |
* FindAGIGameID.c | |
* Description: Check to see if an AGI Sierra game is either version 2 or 3. | |
* Author: Chad Armstrong | |
* Date: 29 April 2020 | |
* To compile: gcc -Wall -o FindAGIGameID FindAGIGameID.c | |
* To run: ./FindAGIGameID | |
* | |
* References: | |
* - https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/glob.3.html |