Skip to content

Instantly share code, notes, and snippets.

@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