Skip to content

Instantly share code, notes, and snippets.

@michaeloyer
michaeloyer / Go Through YesNo Box Flow.au3
Last active February 8, 2020 22:44
An Autoit Script and a VBScript to Demonstrating how to click through dialog boxes on Windows
;Equivalent for setting Hotkeys in AHK:
;^g::GoThroughYesFlow
HotKeySet('^g', 'GoThroughYesFlow')
HotKeySet('^h', 'GoThroughNoFlow')
Func GoThroughYesFlow()
; Don't wait forever for the program's box to appear, just wait one second
; Will be '0' if it times out
$windowHandle = WinWait('Yes or No box', '', 1)
If ($windowHandle = 0) Then
@michaeloyer
michaeloyer / Program.cs
Last active January 11, 2020 00:09
Dapper's Query 'map' and 'splitOn' parameters
using Dapper;
using Microsoft.Data.Sqlite;
using Newtonsoft.Json;
namespace Dappering
{
class Program
{
static void Main(string[] args)
{
@michaeloyer
michaeloyer / PsZip.psm1
Last active December 25, 2019 04:00
Functions for Powershell 4 to zip files or directories (.NET Framework 4.5 Required)
Add-Type -assembly 'System.IO.Compression.FileSystem'
function Zip-Directory([string]$Directory, $Destination) {
if (!(Test-Path $Directory -PathType Container)) {
throw "Directory does not exist: $Directory"
}
$Directory = (Resolve-Path $Directory).Path.TrimEnd('\')
if ($null -ne $Destination) {