Skip to content

Instantly share code, notes, and snippets.

@ggorlen
ggorlen / hello-world.r
Created February 1, 2026 01:20
hello-world.r
x <- list(foo=42, bar=43)
print(x)
@ggorlen
ggorlen / hello-world.sql
Last active February 1, 2026 01:02
hello-world.sql
select 54321;
@ggorlen
ggorlen / number-analyzer.html
Last active January 29, 2026 20:34
Number analyzer
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="description" content="Number Analyzer" />
<meta name="color-scheme" content="dark light" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Number Analyzer</title>
<style>
body {
@ggorlen
ggorlen / star.py
Last active December 28, 2025 23:26
Draw minimal coprime stars
# see https://stackoverflow.com/questions/72943585/how-to-draw-n-pointed-stars-using-turtle#comment140920249_72943585
import math
from turtle import Screen, Turtle
def first_coprime(n):
for k in range(2, n):
if math.gcd(n, k) == 1:
return k
@ggorlen
ggorlen / utc-to-pst.html
Created December 14, 2025 05:51
utc to pst converter
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>UTC → Pacific Time Converter</title>
<!-- Luxon -->
<script src="https://cdn.jsdelivr.net/npm/luxon@3.4.0/build/global/luxon.min.js"></script>
<!-- Chrono -->
@ggorlen
ggorlen / chrono-node-test.html
Last active June 27, 2025 18:03
Testing Chrono Node in the browser
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="color-scheme" content="dark light" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>chrono-node & Date Test</title>
<script src="https://cdn.jsdelivr.net/npm/luxon@2.5.2/build/global/luxon.js"></script>
<style>
* {
@ggorlen
ggorlen / discogs-video-adder.js
Created June 16, 2025 03:56
discogs video adder
// WIP script that auto-adds videos to a discogs release
// TODO: "full album" mode
// TODO: try multiple approaches (with and without artist/album title)
/*
x=[...document.querySelectorAll("[data-track-position]")]
.map(e => e.querySelector("td:nth-child(3) span").textContent).join("\n")
console.log(x)
*/
@ggorlen
ggorlen / slurp-xlsx.js
Last active July 17, 2025 15:18
Read XLSX in Node.js
const XLSX = require("xlsx"); // 0.18.5
const workbook = XLSX.readFile("foo.xlsx", { cellDates: true });
const sheetName = workbook.SheetNames[0];
const worksheet = workbook.Sheets[sheetName];
const data = XLSX.utils.sheet_to_json(worksheet, { defval: "" });
console.log(data);
@ggorlen
ggorlen / index.html
Last active January 25, 2026 03:23
minimal vanilla SPA history router
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
</head>
<body>
<div id="app"></div>
<script>
const nav = `<a href="/">Home</a> |
<a href="/about">About</a> |
@ggorlen
ggorlen / hyperformula-playground.html
Last active May 20, 2025 02:17
HyperFormula Playground
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="description" content="HyperFormula Playground" />
<meta name="color-scheme" content="dark light" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>HyperFormula Playground</title>
<link rel="icon" href="https://fav.farm/⚡" />
<script src="https://cdn.jsdelivr.net/npm/hyperformula@3.0.0/dist/hyperformula.full.min.js"></script>