Skip to content

Instantly share code, notes, and snippets.

View jmcker's full-sized avatar

Jack McKernan jmcker

View GitHub Profile
@jmcker
jmcker / tasks.js
Created January 30, 2022 00:51
Log Google Tasks delimited by a newline so that they can be pasted into Google Keep.
const todoClassName = 'sxojMb fbELB';
const completedClassName = 'RFmU6c';
const todo = [];
const completed = [];
for (const e of document.getElementsByClassName(todoClassName)) {
if (!e.title) continue; // Skip Details sections
todo.push(e.innerText);
}

Keybase proof

I hereby claim:

  • I am jmcker on github.
  • I am jmcker (https://keybase.io/jmcker) on keybase.
  • I have a public key whose fingerprint is D0FD 98A7 9ED6 6C43 432F 1F43 FA8C 0116 7D9A 8CE6

To claim this, I am signing this object:

@jmcker
jmcker / bypass.ps1
Last active July 26, 2020 02:09
Temporarily bypass Windows Defender for improved WSL Python performance
# Getting terrible performance with Python in WSL?
#
# Putting a temporary exception in Windows Defender before running
# your load may speed things up
#
# I put this in a PS script so that I don't:
# - forget to put the exception in every time
# - forget to remove the exception when I'm finished
# - resort to disabling "Real-time protection" for a bit cuz I'm lazy
#
@jmcker
jmcker / README.md
Last active November 15, 2023 11:46
Visual Basic Scripts for displaying extended network adapter and OS build info via WMI. Compatible with SysInternal's BGInfo.

BGInfo Scripts

Local Script Usage

You can also modify and test run the scripts locally using:

cscript .\network-info.vbs
@jmcker
jmcker / wiki.py
Last active April 10, 2020 07:21
Fetch the plain-text representation of any Wikipedia page.
#!/usr/bin/env python3
import sys
import urllib.parse
import requests
def get_article_text(page_titles):
'''
Fetch the plaintext for all of the given pages.
@jmcker
jmcker / spin.sh
Created December 4, 2019 05:55
Simple bash spinner
function spin-wait() {
spin="/-\|"
echo -n "${1:-Press any key to continue...} "
while true
do
printf "\b${spin:i++%${#spin}:1}"
read -n 1 -t 0.25 noop
if [ "${?}" == "0" ]; then
break
@jmcker
jmcker / block-outside-dns.sh
Last active April 14, 2020 06:52
Touch ups for my massive collection of OpenVPN profiles
#!/bin/bash
backup_dir="backup-$(date +%Y-%m-%d_%H:%M:%S)"
mkdir -p "${backup_dir}"
cp *.ovpn "${backup_dir}"
for file in $(ls *.ovpn)
do
if ! cat "${file}" | grep "block-outside-dns" > /dev/null; then
echo "Adding 'block-outside-dns' to ${file}..."
@jmcker
jmcker / netsh-profile-export.ps1
Last active September 30, 2023 15:27
Bulk import/export of Windows wireless network profiles.
netsh wlan export profile key=clear
@jmcker
jmcker / index.html
Last active May 11, 2019 09:33 — forked from jarek-foksa/index.html
Electron 5.x demo app that demonstrates how to enable ES modules support.
<!DOCTYPE html>
<html>
<head>
<base href="app://./" />
<meta http-equiv="Content-Security-Policy" content="script-src 'self' app:; object-src 'self' app:;">
<script type="module" src="./module.js"></script>
</head>
<body>
Check the console!
@jmcker
jmcker / git-prot.sh
Last active April 2, 2019 22:11
Switch all remotes in a git repo from HTTP to SSH (and vice-versa) with a single command. (Doesn't work perfectly right now. Be careful)
#!/bin/bash
TO_HTTP="false"
BASE_HOST="github.com"
function help-text() {
echo "git-protocol-switcher (git-prot)"
echo " Switch all remotes in a git repo from HTTP to SSH (and vice-versa) with a single command."
echo " This assumes a host of https://github.com"
echo