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
import Foundation | |
import Network | |
/// A quick and dirty playground/script to get the current device's public IP address, validate it, and print it | |
let url = URL(string: "https://checkip.amazonaws.com")! | |
var publicIPAddress: IPAddress? | |
URLSession.shared.dataTask(with: url) { (data, response, error) in | |
guard let data = data, |
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
// The bookmarklet does a couple things: | |
// If the current page in the browser is a YouTube page, it will open that video in `invidious.xyz` | |
// If the current page in the browser is _not_ a YouTube page, it will open the `invidious.xyz` homepage | |
// | |
// To use: Copy/Paste the code below into the bookmark's address: | |
javascript:location.hostname.includes("youtube.com")?location.assign("https://invidious.xyz"+location.pathname+location.search+location.hash):location.assign("https://invidious.xyz"); |
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
function git-orphan --description "Creates an orphan branch and a README.md file" | |
# Create an orphan branch named "default" | |
git checkout --orphan default | |
# Delete everything in the directory that is tracked by git | |
git rm -rf . | |
# Delete everything in the directory that is NOT tracked by git | |
git clean -dfx |
OlderNewer