Skip to content

Instantly share code, notes, and snippets.

@smmcdonald
smmcdonald / readme.md
Last active January 15, 2026 03:35
Launch Elite Dangerous and Companion Programs

Right-click on your desktop → New → Shortcut

For location, enter: powershell.exe -ExecutionPolicy Bypass -File "C:\Path\To\Your\welcome_commander.ps1"

Name it "Launch Elite Dangerous" or whatever you wish

You can also assign a custom icon by right-clicking the shortcut → Properties → Change Icon

@smmcdonald
smmcdonald / Close Applications Opened on Startup.xml
Last active January 15, 2026 01:39
This Powershell script closes a series of application windows that are opened on Windows 10 startup. This script was tested and working on Windows 10 Version 22H2. This script is intended to be run from a .cmd (see close_application_window.cmd) file when run as a scheduled task (see Close Applications Opened on Startup.xml) of a Windows user log…
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.4" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<Date>2026-01-08T12:04:32.2243302</Date>
<Author>YOUR-MACHINE-NAME\YOUR-USERNAME</Author>
<Description>Close Applications Opened on Startup</Description>
<URI>\Microsoft\Windows\Close Applications Opened on Startup</URI>
</RegistrationInfo>
<Triggers>
<LogonTrigger>
@smmcdonald
smmcdonald / AutoHideTaskbar.cmd
Last active May 12, 2025 13:21
Auto-hide Windows taskbar
:: This cmd file is intended to be used with a task scheduler trigger (taskschd.msc). For example:
:: On workstation unlock
powershell -command "&{$p='HKCU:SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3';$v=(Get-ItemProperty -Path $p).Settings;$v[8]=3;&Set-ItemProperty -Path $p -Name Settings -Value $v;&Stop-Process -f -ProcessName explorer}"
@smmcdonald
smmcdonald / ForceUpdate.swift
Created May 28, 2021 17:10
Check app version strings
func checkAppVersion(requiredVersion: String) {
guard let version = Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String else { return }
let currentVersionNumbers = version.components(separatedBy: ".")
let requiredVersionNumbers = requiredVersion.components(separatedBy: ".")
var count = 0
for number in currentVersionNumbers {
if count < requiredVersionNumbers.count {
if compareNumeric(number, requiredVersionNumbers[count]) == .orderedAscending {
//TODO: self.forceUpdate() here
/// Usage: Pass in the name of the UIViewController you wish to pop back to in the navigation stack. If no matching UIViewController is found, this fails silently.
/// Example: popToViewController(viewController: String(describing: StoreDetailsViewController.classForCoder()))
extension UIViewController {
func popToViewController(viewControllerNamed: String) {
if let viewControllers: [UIViewController] = self.navigationController?.viewControllers {
for view in viewControllers {
if (String(describing: view.classForCoder) == viewControllerNamed) {
self.navigationController?.popToViewController(view, animated: true)
break
}
@smmcdonald
smmcdonald / strings.dart
Created November 25, 2019 15:34
Utility for space delimited string capitalization in dart because I couldn't find a public one.
/// Returns a string with capitalized first character of every empty space seperated word.
///
/// Example:
/// print(capitalize("123 Sean is super AwEsOmE 456!"));
/// => 123 Sean Is Super Awesome 456!
String capitalize(String string) {
if (string == null) {
throw ArgumentError("string: $string");
}
This file has been truncated, but you can view the full file.
User defaults from command line:
IDEArchivePathOverride = /var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/__archive__406408938/Little Caesars.xcarchive
Build settings from command line:
COMPILER_INDEX_STORE_ENABLE = NO
Prepare build
note: Using legacy build system
=== BUILD TARGET BiometricAuthentication OF PROJECT Pods WITH CONFIGURATION Release ===
@smmcdonald
smmcdonald / gist:d2ed7fde54d90e33e400356f4c821162
Created May 15, 2018 19:06
One-liner to revert to last good commit
git push -f origin last_known_good_commit:branch_name
@smmcdonald
smmcdonald / gist:64e041c7112d78db727f0be469a5ac38
Created July 27, 2016 20:45
Regex for finding Git merge conflicts in Sublime 2
(?s)(<<<<<<< HEAD)(.*?)(\=\=\=\=\=\=\=)
@smmcdonald
smmcdonald / TextViewWebLinks.m
Created July 29, 2015 14:38
Web links in UITextViews