Skip to content

Instantly share code, notes, and snippets.

View jcwillox's full-sized avatar

Josh Willox jcwillox

View GitHub Profile
@jcwillox
jcwillox / press_keys.py
Last active March 16, 2022 07:12
Simple Python script to rapidly press a set of keys
import argparse
from string import digits
from time import sleep
import pydirectinput
import win32api
import win32con
parser = argparse.ArgumentParser(description="Repeatedly press keyboard keys")
parser.add_argument("key", nargs="*", default=list(digits))
@jcwillox
jcwillox / toolbox-context-menu.ps1
Last active January 23, 2024 03:54
PowerShell script to automatically add context menu entries for Jetbrains IDEs
<#
.SYNOPSIS
Automatically add context menu entries for Jetbrains IDEs.
.PARAMETER Name
The name or names of the IDEs to add context menus for, use -List to see available IDEs.
.PARAMETER BasePath
The path to the Toolbox apps directory, defaults to "$env:LOCALAPPDATA\JetBrains\Toolbox\apps".
.PARAMETER Global
Install context menu entries in HKLM registry (machine wide), requires running as administrator.
.PARAMETER Force
@jcwillox
jcwillox / pnpm.ps1
Last active November 18, 2023 01:38
PowerShell Completion Script for `pnpm`
# powershell completion for pnpm -*- shell-script -*-
Register-ArgumentCompleter -CommandName 'pnpm' -ScriptBlock {
param(
$WordToComplete,
$CommandAst,
$CursorPosition
)
function __pnpm_debug {
@jcwillox
jcwillox / ilearn-html-beautify.user.js
Last active August 9, 2021 08:04
Make plain HTML pages on iLearn fancy
// ==UserScript==
// @name iLearn HTML Beautify
// @version 0.2.1
// @description Make plain HTML pages on iLearn fancy
// @author jcwillox
// @license MIT
// @include https://ilearn.mq.edu.au/pluginfile.php/*.html
// @include https://ilearn.mq.edu.au/pluginfile.php/*.htm
// @run-at document-start
// @grant GM_addStyle
@jcwillox
jcwillox / log-version.custom.js
Created August 8, 2021 09:24
Userscript extension to log version and name of the script to the console
function logVersion(primary = "#039BE5", secondary = "white") {
let name = GM_info.script.name.toUpperCase();
let version = GM_info.script.version;
console.info(
`%c ${name} %c ${version} `,
`color: ${secondary}; background: ${primary}; font-weight: 700;`,
`color: ${primary}; background: ${secondary}; font-weight: 700;`
);
}