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
| /* | |
| * erasefreespace.m | |
| * Description: Parse a string for the percentage of freespace erased | |
| * Author: Chad Armstrong | |
| * Date: 3 October 2017 | |
| * To compile: gcc -framework Foundation erasefreespace.m -o erasefreespace | |
| */ | |
| #import <Foundation/Foundation.h> |
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
| ls *.tif | xargs sips -s format tiff -s formatOptions lzw |
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
| var s_ajaxListener = new Object(); | |
| s_ajaxListener.tempOpen = XMLHttpRequest.prototype.open; | |
| s_ajaxListener.tempSend = XMLHttpRequest.prototype.send; | |
| s_ajaxListener.callback = function () { | |
| window.location='mpAjaxHandler://' + this.url; | |
| }; | |
| XMLHttpRequest.prototype.open = function(a,b) { | |
| if (!a) var a=''; | |
| if (!b) var b=''; |
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 objc, os | |
| from Foundation import * | |
| from AppKit import * | |
| ACScriptSuperMenuTitle = None | |
| ACScriptMenuTitle = "Compress with TinyPNG" | |
| ACShortcutKey = 'i' | |
| ACShortcutMask = "command control" | |
| ACIsAction = True |
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/sh | |
| VER1=2.6.33.2 | |
| VER2=2.6.38 | |
| OSVERSION=`sw_vers -productVersion` | |
| echo "Current OS Version: $OSVERSION" | |
| echo "Arg 2 : $# $0 $1 $2" | |
| if [[ $VER1 > $VER2 ]]; 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
| /* | |
| * 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 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/sh | |
| # Erase freespace from the command line: diskutil secureErase freespace [level] [device] | |
| if [ "$#" -lt 1 ]; then | |
| echo "$0: too few arguments" | |
| echo "Usage: $0 path/to/disk" >&2 # echo error to stderr | |
| exit 1 | |
| fi |
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/sh | |
| # TSS = Take Simulator Screenshot | |
| # Script workaround for the crash in Xcode 8 Simulator crashing when | |
| # trying to save a screenshot in El Capitan | |
| # Version: 1.2 (3 February 2017) - Add screenshot to clipboard | |
| # Version: 1.1 (31 January 2017) - Play screenshot file | |
| # Version: 1.0 (Early January 2017) - Initial version | |
| # Change to the Desktop, take the screenshot, then move back to the original directory |
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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>Label</key> | |
| <string>local.updateticketsreminder</string> | |
| <key>ProgramArguments</key> | |
| <array> | |
| <!-- osascript -e 'display notification "Update your tickets" with title "Reminder" sound name "Sosumi"' --> | |
| <string>/usr/bin/osascript</string> |
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
| -- CountOpenSafariTabs.scpt | |
| -- Author: Chad Armstrong | |
| -- Date: 13 May 2016 | |
| -- Description: Count the number of open tabs in Safari | |
| -- To run from CLI: osascript CountOpenSafariTabs.scpt | |
| tell application "Safari" | |
| --Variables | |
| set winlist to every window |