Skip to content

Instantly share code, notes, and snippets.

@ggorlen
ggorlen / novice-javascript.md
Last active June 8, 2026 06:37
Novice JavaScript

Novice JavaScript

Context

This article discusses strategies for teaching 100% novice programmers--the very first program and next steps after it. Target audience is grade and high school.

Problem: the quiz app

For new programmers, particularly kids, Python is the default choice for good reason: it's perfect for simple interactive apps:

@ggorlen
ggorlen / better-git-stats.py
Created May 16, 2026 14:07
better git stats
#!/usr/bin/env python3
# Git stats are misleading because some people squash merge and some people
# create merge commits, bringing their history of commits from the branch onto
# master and making it look like they did way more work relative to squashers.
#
# This tries to treat merge commits as if they were squash merged so repo stats
# are actually normalized/comparable. It also merges by identical name and email.
#
# I'm sure this isn't 100% accurate, particularly for LOC, but anecdotally seems
@ggorlen
ggorlen / automating-life.md
Last active June 8, 2026 06:52
automating life

Automating Life

What have we done with technology?

  • cars: privatized/corporatized/automated walking, biking, public transit, horses
    • outcome: walkable urban centers and close-knit towns become exurbs and strip malls, ubiquitous noise, pollution and car infra, all humans required to fork over hundreds of thousands of dollars per life just to get around the way they used to be able to do for free, super long commutes, obsesity, 40k deaths per year in the US, environmental damage, lead poisoning, now cars are massively reliant on computer chips and can't be repaired easily, etc. Enabler of classical big box store style consumption.
  • smart phones: the control center that runs everything else and enables most other automation, replaces wallets, credit cards, traditional phones, video cameras, photo cameras, alarm clocks, music players, transit cards, watches, books, TVs, calculators, and most other single-purpose consumer goods of the 20th century
  • outcome: impossible to survive without technological k
@ggorlen
ggorlen / slack-post-from-cli.md
Created May 12, 2026 23:22
Siphon tokens from Chrome with AppleScript

Post to Slack as yourself from the CLI (macOS + Chrome)

Slack's xoxc- session tokens require an HttpOnly d cookie that JavaScript can't read. But you don't need to extract it. By running fetch() inside Chrome's Slack tab via AppleScript, the browser attaches the cookie automatically.

No bots, no webhooks, no OAuth apps. Just your existing Slack session.

Requirements

  • macOS (uses osascript)
  • Chrome with a app.slack.com tab open
@ggorlen
ggorlen / example-software-design-document.md
Last active June 7, 2026 02:12
example software design document

Example Software Design Document

Purpose

The app will be a full-stack, multi-user wiki application, basically a simplified Wikipedia.

Technologies

  • Front end: React with React Router and the marked library for rendering markdown
  • Back end:
@ggorlen
ggorlen / food.md
Last active May 13, 2026 17:36
food
  • rice ratios: 2 cups white to 3 and 1/8 cups water, for brown, 2 cups brown to 3 cups water
  • congee
  • tomato or lentil soup
  • risotto: arborio rice, get 6+ cups of water on boil in a separate pot, cook the rice in another pot gradually ladeling in water from the boiling pot. can add some miso for flavor.
@ggorlen
ggorlen / music.md
Last active May 3, 2026 21:21
music

Music ideas

  • some day, take a bunch of time off and just crank out black thread tape loop music with synth + gtr, what's there to lose? use the gear before it dies and get some massive release together
  • look into amp modeler software
  • do greensleeves etc in pure data or supercollider, or modplug, or ultraabox
  • try that krautrock 2 chord guitar idea, see mantra by stick men for interesting similar time signature thing
  • make an atmospheric mc 202 album like sonno from cortini
  • could use pure data or something to generate midi: https://www.discogs.com/release/31033435-Colin-Marston-Solo-Instruments
  • title: "landscape of fadedness"
  • https://en.wikipedia.org/wiki/Ostrich_guitar / monochord
@ggorlen
ggorlen / vue-try-array-composables.html
Created April 26, 2026 20:28
vue try array composables
<!doctype html>
<div id="app">
<button @click="newConversation()">
New Conversation
</button>
<div v-for="(conversation, index) in conversations" :key="index">
<h3>Conversation {{ index + 1 }}</h3>
<ul>
<li v-for="message in conversation.messages" :key="message">{{ message }}</li>
</ul>
@ggorlen
ggorlen / har-minimizer.html
Last active April 10, 2026 21:44
HAR minimizer.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>HAR Cleaner</title>
<style>
:root { color-scheme: light dark; }
body { margin:0; font-family: system-ui, sans-serif; }