Skip to content

Instantly share code, notes, and snippets.

View draffensperger's full-sized avatar

Dave Raffensperger draffensperger

View GitHub Profile
@draffensperger
draffensperger / index.js
Last active January 1, 2020 06:46
Record Event to Google Sheets via Cloud Function
// Records a event with a given timestamp to a google sheet
const { google } = require("googleapis");
exports.recordEvent = async (req, res) => {
if (!crypto.timingSafeEqual(Buffer.from(req.body.key),
Buffer.from(process.env.KEY)) {
return;
}
@draffensperger
draffensperger / gist:54ff580bef6b4f8bd13697944121e490
Created November 12, 2020 14:57
SurfingKeys hints chartacters
// Here's how the hints work:
// First 20 characters are used as single-character hints, and then it
// switches to 2-character hints using the next characters. I wanted to make
// sure that the two character hints were easy to push.
// 000000000011111111112
// 012345678901234567890
Hints.characters = 'dkls;aie,cow.xpq/zvmrufj';
@draffensperger
draffensperger / fuzzy_name_lookup.bas
Last active November 24, 2021 13:20
Excel VBA module for fuzzy lookup (via Levenshtein distance) for a person id by first name and last name in a person range that has first, last, full and id fields.
Option Explicit
Private Type PersonQuery
firstName As String
lastName As String
fullName As String
firstNames As Range
lastNames As Range
fullNames As Range
namesSwapped As Boolean