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 fish | |
# Needs rg: `brew install ripgrep` | |
set -xg visitedLibs | |
function libdeps -a bin depth -d "Finds all dylibs that a binary depends on recursively and prints them on separate lines, sorted alphabetically" | |
if test -z "$depth" | |
set depth 0 | |
end |
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 Cocoa | |
import Foundation | |
func restart() { | |
// Check if the app was started fresh or if was restarted with arg `restarts=timestamp:timestamp:...` | |
// If the app was restarted more than 3 times in 10 seconds, exit with status 1 | |
guard CommandLine.arguments.count == 1 || ( | |
CommandLine.arguments.count == 2 && CommandLine.arguments[1].starts(with: "restarts=") | |
) else { |
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
// swiftc -o /tmp/InternetReachable ~/Temp/InternetReachable.swift && /tmp/InternetReachable | |
import AppKit | |
import Cocoa | |
import Foundation | |
import Network | |
private var window: NSWindow = { | |
let w = NSWindow( | |
contentRect: NSRect(x: 0, y: 0, width: NSScreen.main!.frame.width, height: 20), |
OlderNewer