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 () {
#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 / 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\" />"
@Narvey
Narvey / .gitconfig
Last active September 16, 2020 22:05
Git configuration file for my aliases and settings.
[branch]
autoSetupMerge = always
[alias]
st = status
ca = commit -am
br = branch
co = checkout
clr = reset HEAD
df = diff
dc = diff --cached
{
"$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: