Skip to content

Instantly share code, notes, and snippets.

View Narvey's full-sized avatar

Nathan Harvey Narvey

View GitHub Profile
@Narvey
Narvey / .bootcde
Last active January 31, 2021 01:53
SmartWatch script (Javascript for running on Espruino Pico)
var modeBtn = BTN1; //set the pin here used for mode button.
var actBtn = A2;
var flashDelay = 370; //milliman
pinMode(modeBtn, "input_pulldown");
pinMode(actBtn, "input_pulldown");
function blink(times, led) {
times = +times;
var count = 0;
var ivF = setInterval(function () {
@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\" />"
{
"$jason": {
"head": {
"title": "Afternoon Devotions",
"description": "for Harveys",
"offline": "true",
"styles": {},
"actions": {"$load":[{
"{{#if $global.curDate}}": {
"type": "$util.banner",
@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
@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)
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
#Just a couple of lines
#written in Powershell but how would you know?

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:

@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')
@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
}