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
# Download photos from the remote server | |
do shell script "rsync -avz --delete -e 'ssh -p 22' [email protected]:/path/to/photos/ /Users/username/Pictures/SomeFolder/" | |
set folderPath to alias "Users:username:Pictures:SomeFolder" | |
set imageList to getImageList(folderPath) | |
# Import the list of photos into Photos.app | |
if number of items in imageList is greater than 0 then | |
tell application "Photos" | |
activate |
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
- (void)outlineViewItemDidCollapse:(NSNotification *)notification { | |
VirtualHost *vh = [[[notification userInfo] valueForKey:@"NSObject"] representedObject]; | |
vh.isExpandedValue = NO; | |
} | |
- (void)outlineViewItemDidExpand:(NSNotification *)notification { | |
VirtualHost *vh = [[[notification userInfo] valueForKey:@"NSObject"] representedObject]; | |
vh.isExpandedValue = YES; | |
} | |
</code></pre> |
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
<?php | |
if(isset($_SERVER['HTTP_X_ORIGINAL_HOST'])) { | |
$proto = empty($_SERVER['HTTP_X_FORWARDED_PROTO']) ? 'http' : (($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') ? 'https' : 'http'); | |
$url = $proto . '://' . $_SERVER['HTTP_X_ORIGINAL_HOST']; | |
if($proto == 'https') { $_SERVER['HTTPS'] = 'on'; } | |
} else { | |
$s = empty($_SERVER['HTTPS']) ? '' : ($_SERVER['HTTPS'] == 'on') ? 's' : ''; | |
$port = ($_SERVER['SERVER_PORT'] == '80') ? '' : (":".$_SERVER['SERVER_PORT']); | |
$url = "http$s://" . $_SERVER['HTTP_HOST'] . $port; | |
} |
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
tell application "VirtualHostX" | |
set devSite to make new website | |
set devSite's name to "dev-website" | |
set devSite's local path to "/Users/thall/Sites/tylerio" | |
apply changes | |
set urlToOpen to local url of devSite | |
tell application "Safari" |
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 | |
kill -9 `ps -ax | grep imacvpn | head -n1 | cut -f1 -d " "` |
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
var leftExpressions = [ | |
NSExpression(forKeyPath: "pageTitle"), | |
NSExpression(forKeyPath: "pageDescription"), | |
NSExpression(forKeyPath: "content"), | |
NSExpression(forKeyPath: "url") | |
] | |
var operatorTypes = [ | |
NSNumber(value: NSComparisonPredicate.Operator.equalTo.rawValue), | |
NSNumber(value: NSComparisonPredicate.Operator.contains.rawValue), | |
NSNumber(value: NSComparisonPredicate.Operator.beginsWith.rawValue), |
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
> Ears --help | |
USAGE: ears [--input <input>] [--output <output>] [--list-outputs] [--list-inputs] | |
OPTIONS: | |
-i, --input <input> The audio input device to make current. | |
The name must be an exact match. | |
-o, --output <output> The audio output device to make current. | |
The name must be an exact match. | |
--list-outputs Show available output devices. | |
--list-inputs Show available input devices. |
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
tell application "Ears" | |
set audio input "Soundcore Life Q20" | |
set audio output "iMac Pro Speakers" | |
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
# Solves https://tyler.io/so-uh-i-think-catalina-10154-broke-ssh/ | |
If you add a timeout to your SSH command, it will work. | |
ssh -p 6789 -oConnectTimeout=10 domain.com | |
Or, you can automatically apply it to all SSH connections by adding | |
Host * | |
ConnectTimeout 10 |