Skip to content

Instantly share code, notes, and snippets.

View Narvey's full-sized avatar

Nathan Harvey Narvey

View GitHub Profile
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn ; Enable warnings to assist with detecting common errors.
#SingleInstance force
#persistent
defaultMode=2
SetTitleMatchMode,%defaultMode% ;mainly for sub-scripts that may actually need to match on title.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
;Ctr-Sft-?: Help window listing shortcuts
@Narvey
Narvey / SpotlightImageFinder.ps1
Created December 13, 2018 22:33
You know those pretty Windows 10 lock screen Spotlights? Sometimes it can be hard to find the one you want when all the file extensions are janky. Well use this script to pull all the recent ones up in tabs in FireFox, then you can right-click and save image for the one you want.
$daysBack = 3
$list = ls "$env:LOCALAPPDATA\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets" | `
Where-Object {$_.Length -gt 90000 -and ([datetime]::Now - $_.LastWriteTime) -lt [timespan]::FromDays($daysBack)}
foreach ($file in $list)
{
& "C:\Program Files\Mozilla Firefox\firefox.exe" $file.FullName
}
@Narvey
Narvey / decoding.js
Created February 1, 2019 19:04
a snippet of a decoder I wrote real quick for this dumb hex-based encoding Proofpoint uses for email subject lines
working = working.replace(/C/,'2')
.replace(/H/,'7')
.replace(/E/,'4')
.replace(/A/,'0')
.replace(/D/,'3')
.replace(/B/,'1')
.replace(/O/,'e')
.replace(/J/,'9')
.replace(/K/,'a')
.replace(/M/,'c')

Keybase proof

I hereby claim:

  • I am narvey on github.
  • I am narvey (https://keybase.io/narvey) on keybase.
  • I have a public key ASA6aH67S1zZaRHa3p3UWn-fl7VFJHrsQd48Ffpa8TOPrwo

To claim this, I am signing this object:

#Just a couple of lines
#written in Powershell but how would you know?
deb http://deb.debian.org/debian/ stretch main contrib non-free
deb-src http://deb.debian.org/debian/ stretch main contrib non-free
deb http://security.debian.org/ stretch/updates main contrib non-free
deb-src http://security.debian.org/ stretch/updates main contrib non-free
@Narvey
Narvey / directoryparse.js
Created April 14, 2020 21:27
Parsing of our church directory (I used this in the js scratchpad, but console should work too)
contacts = []
;[...document.getElementsByClassName("household")].forEach(div=>
{
let names = [... div.getElementsByTagName("b")].map(e=>e.innerText)
let results = /(\w+)['’]s Cell ([-0-9]+)/.exec(div.innerText)
let surname = names[0]
if (surname.split(" ").length>1)//check for the unmarried
{
surname = surname.split(" ")[1] //grab surname
console.log(surname)
@Narvey
Narvey / fixAnnoying.reg
Created April 22, 2020 14:00
disable windows annoyingness (shake to minimize and worst key ever invented: CAPSLOCK)
Windows Registry Editor Version 5.00
;disable CAPS
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,00,00,3a,00,00,00,00,00
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
"DisallowShaking"=hex:01
{
"$jason": {
"head": {
"title": "Afternoon Devotions",
"description": "for Harveys",
"offline": "true",
"styles": {},
"actions": {"$load":[{
"{{#if $global.curDate}}": {
"type": "$util.banner",
@Narvey
Narvey / barcodify.js
Created October 17, 2020 02:42
barcodify
var title = "Put Title with num 8345834 Here"
var nums = match(/\d\d+\d/)[0]
var html = "<h4>" + title + "</h4><img src=\"http://api.labelary.com/v1/printers/8dpmm/labels/2.5x1.2/0/^xa^fo100,100^bcn,100^fd" + nums + "^fs^xz\" />"