Skip to content

Instantly share code, notes, and snippets.

@jonathanhudak
jonathanhudak / server.ts
Created May 22, 2022 04:56
Simple Deno Web Server for Generating QR Codes
import { qrcode } from "https://deno.land/x/qrcode/mod.ts";
import { Application, Router } from "https://deno.land/x/oak/mod.ts";
// https://github.com/denorg/qrcode
// https://github.com/oakserver/oak
interface HTMLPageOptions {
body: string;
}
@jonathanhudak
jonathanhudak / setup_package.sh
Last active November 3, 2022 05:04
Setup NPM Package
#!/bin/bash
# This script installs and configures typescript, eslint, prettier and commitizen for a basic NodeJS package.
# If all goes well you will have precommit hooks that lint and format your code and a prompt to craft a conventional commit message. 😎
# It is largely based on https://jamesandrewwright.com/articles/commitizen-eslint-prettier-husky/
step() {
read -p "$1? " -r
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]
then
# https://linuxize.com/post/bash-write-to-file/
cat << EOF > file.txt
The current working directory is: $PWD
You are logged in as $(whoami)
EOF
#!/usr/bin/env bash
# Add to your ~/.zshrc or ~/.profile
# source: https://gist.github.com/mob-sakai/174a32b95572e7d8fdbf8e6f43a528f6
gist() {
GIST_URL=$1
if [[ ! $GIST_URL ]]; then
echo -e "\nGIST_URL is required\n"
else
shift
@jonathanhudak
jonathanhudak / chat-gpt.md
Last active February 10, 2023 06:25
KeyBoard to Piano Mappings

Me

Could you produce dictionary in javascript of keyboard key codes to piano keyboard following the MAX mapping?

Sure, here is an example of a JavaScript dictionary that maps keyboard key codes to piano keyboard notes following the MAX mapping:

const keyCodeToPianoKey = {
<nav>
<a href="/">Home</a>
<a href="/about">About</a>
</nav>
{
"nav": "0f142ffa935850569a0a05e0b8064322",
"footer": "94d242d29c7b63a67acf96b64053f2ac",
"routes": {
"/": "a5a50ed1011bf5e9e2ab8941dab6cc30",
"/about": "4c7ad16e312a29f0079a226b886e5016"
},
"webComponents": "bc5c6697a30f413643c8529875037123"
}
<h1>Gist Quilt</h1>
<p>
Using Deno to piece together a quilt of GitHub Gists into a single HTML page.
</p>
<h1>About</h1>
<p>Very busy 🐇. No time to explain, Arseniy.</p>