This is a recursive version of PHP's ksort function.
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
| // | |
| // FileURL.swift | |
| // Created by Chris Dzombak on 11/16/16. | |
| // | |
| import Validated | |
| public typealias FileURL = Validated<URL, FileURLValidator> | |
| public struct FileURLValidator: Validator, _FileURL_Validating { |
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 tasks from Things to OmniFocus | |
| -------------------------------------------------- | |
| -------------------------------------------------- | |
| -- | |
| -- Script taken from: http://forums.omnigroup.com/showthread.php?t=14846&page=2 | |
| -- Added: creation date, due date, start date functionality | |
| -- Empty your Things Trash first. | |
| -- Note that this won't move over scheduled recurring tasks. |
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
| #!/usr/bin/env bash | |
| set -uo pipefail | |
| if [ "$EUID" -ne 0 ]; then | |
| echo "please run as root for a complete index" | |
| exit 1 | |
| fi | |
| echo "systemd services" | |
| echo "================" |
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>GroupName</key> | |
| <string>staff</string> | |
| <key>InitGroups</key> | |
| <true/> | |
| <key>Label</key> | |
| <string>com.dzombak.iperf3</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
| # based on sidekiq.chart.sh by codl <codl@codl.fr> | |
| # | |
| # apt install netdata-plugin-chartsd redis-tools | |
| # put this in /usr/libexec/netdata/charts.d | |
| # chown root:netdata /usr/libexec/netdata/charts.d/sidekiq.chart.sh && chmod +x /usr/libexec/netdata/charts.d/sidekiq.chart.sh | |
| sidekiq_update_every=5 | |
| sidekiq_priority=9000 | |
| sidekiq_check() { |
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 AppleScript version "2.4" -- Yosemite (10.10) or later | |
| on replace_chars(this_text, search_string, replacement_string) | |
| set AppleScript's text item delimiters to the search_string | |
| set the item_list to every text item of this_text | |
| set AppleScript's text item delimiters to the replacement_string | |
| set this_text to the item_list as string | |
| set AppleScript's text item delimiters to "" | |
| return this_text | |
| end replace_chars |
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
| -- RESET VALUES | |
| set urlList to {} | |
| set currentTab to 0 | |
| -- SET DATE STAMP | |
| set the dateStamp to ((the current date) as string) | |
| set noteTitle to "URL List from Chrome Tabs on " & the dateStamp | |
| -- PROCESS TABS OF FRONTMOST CHROME WINDOW | |
| tell application "Google Chrome.app" |
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
| try | |
| tell application id "com.culturedcode.ThingsMac" to activate | |
| tell application "System Events" | |
| tell process "Things" | |
| click menu item "New Things Window" of menu "File" of menu bar item "File" of menu bar 1 | |
| click menu item "Quick Find…" of menu "Edit" of menu bar item "Edit" of menu bar 1 | |
| end tell -- Things | |
| end tell -- System Events | |
| on error e number n | |
| display dialog "Error " & n & ": " & e |
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
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| # from https://stackoverflow.com/a/66723000 | |
| function screenIsLocked { [ "$(/usr/libexec/PlistBuddy -c "print :IOConsoleUsers:0:CGSSessionScreenIsLocked" /dev/stdin 2>/dev/null <<< "$(ioreg -n Root -d1 -a)")" = "true" ] && return 0 || return 1; } | |
| function screenIsUnlocked { [ "$(/usr/libexec/PlistBuddy -c "print :IOConsoleUsers:0:CGSSessionScreenIsLocked" /dev/stdin 2>/dev/null <<< "$(ioreg -n Root -d1 -a)")" != "true" ] && return 0 || return 1; } | |
| if screenIsLocked; then | |
| echo "Screen locked" |
NewerOlder