View MusicCleanupHelper.swift
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
// Trying to cleanup my music library this morning. | |
// It was easier to write this script in Swift than | |
// try and figure out the equivalent in Bash. | |
// | |
// I'm using this in conjunction with Beets <https://beets.io/>. | |
// | |
// Prior to importing music into my library with Beets, this | |
// script attempts to callout any problematic album folders that: | |
// | |
// 1. Contain BOTH .flac and at least one lossy format |
View github.css
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
body { | |
font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif; | |
font-size: 16px; | |
line-height: 1.6; | |
padding-top: 10px; | |
padding-bottom: 10px; | |
background-color: white; | |
padding: 30px; | |
} |
View config
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 |
View Ears-Example.applescript
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 |
View Ears-CLI-Examples.txt
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. |
View Example.swift
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), |
View killSSHTunnel.sh
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 " "` |
View VirtualHostX-Pro-AppleScript-Example.scpt
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" |
View wp-config.php
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; | |
} |
View OutlineViewController+Extension.m
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> |
NewerOlder