Skip to content

Instantly share code, notes, and snippets.

View typesend's full-sized avatar

Ben Damman typesend

  • Missoula, Montana
  • 09:49 (UTC -06:00)
  • X @typesend
View GitHub Profile
@markuman
markuman / README.md
Last active February 11, 2025 11:30
🗺️ OSM - self host the entire planet 🌎 in ~30 minutes 🚀

🗺️ OSM - self host the entire planet 🌎 in ~30 minutes 🚀

TL;DR

mkdir osm
wget -O osm/planet.mbtiles https://hidrive.ionos.com/api/sharelink/download?id=SYEgScrRe
podman run -ti --rm -p 9000:9000 --name sms -v $(pwd)/osm/:/data/ registry.gitlab.com/markuman/sms:latest
firefox http://localhost:9000
@rain-1
rain-1 / LLM.md
Last active April 8, 2025 13:49
LLM Introduction: Learn Language Models

Purpose

Bootstrap knowledge of LLMs ASAP. With a bias/focus to GPT.

Avoid being a link dump. Try to provide only valuable well tuned information.

Prelude

Neural network links before starting with transformers.

@oscarychen
oscarychen / postgres_ltree.sql
Created March 11, 2023 02:07
Postgres Ltree Cheatsheet
CREATE EXTENSION ltree;
CREATE TABLE test (path ltree);
-- Top
-- / | \
-- Science Hobbies Collections
-- / | \
-- Astronomy Amateurs_Astronomy Pictures
@dustingetz
dustingetz / crud.cljc
Last active February 20, 2022 02:06
100 LOC crud app
(ns user.blog-100-loc-crud-app
"Concrete minimum viable crud app that demonstrates strong composition and real world edge cases"
(:require
[clojure.spec.alpha :as s]
#?(:clj [datomic.api :as d])
[hyperfiddle.api :as hf]
[hyperfiddle.photon :as p]
[hyperfiddle.photon-dom :as dom]
[hyperfiddle.html5 :as-alias html]))
@vncsna
vncsna / bash_strict_mode.md
Created June 6, 2021 01:59 — forked from mohanpedala/bash_strict_mode.md
set -e, -u, -o, -x pipefail explanation

set -e, -u, -o, -x pipefail

The set lines

  • These lines deliberately cause your script to fail. Wait, what? Believe me, this is a good thing.
  • With these settings, certain common errors will cause the script to immediately fail, explicitly and loudly. Otherwise, you can get hidden bugs that are discovered only when they blow up in production.
  • set -euxo pipefail is short for:
set -e
set -u
@onlurking
onlurking / programming-as-theory-building.md
Last active March 28, 2025 02:18
Programming as Theory Building - Peter Naur

Programming as Theory Building

Peter Naur

Peter Naur's classic 1985 essay "Programming as Theory Building" argues that a program is not its source code. A program is a shared mental construct (he uses the word theory) that lives in the minds of the people who work on it. If you lose the people, you lose the program. The code is merely a written representation of the program, and it's lossy, so you can't reconstruct

@goliatone
goliatone / README.md
Last active February 1, 2025 14:55 — forked from colophonemes/create_triggers
Postgres TRIGGER to call NOTIFY with a JSON payload

This TRIGGER function calls PosgreSQL's NOTIFY command with a JSON payload. You can listen for these calls and then send the JSON payload to a message queue (like AMQP/RabbitMQ) or trigger other actions.

Create the trigger with notify_trigger.sql.

When declaring the trigger, supply the column names you want the JSON payload to contain as arguments to the function (see create_triggers.sql)

The payload returns a JSON object:

@lisawolderiksen
lisawolderiksen / git-commit-template.md
Last active April 7, 2025 01:52
Use a Git commit message template to write better commit messages

Using Git Commit Message Templates to Write Better Commit Messages

The always enthusiastic and knowledgeable mr. @jasaltvik shared with our team an article on writing (good) Git commit messages: How to Write a Git Commit Message. This excellent article explains why good Git commit messages are important, and explains what constitutes a good commit message. I wholeheartedly agree with what @cbeams writes in his article. (Have you read it yet? If not, go read it now. I'll wait.) It's sensible stuff. So I decided to start following the

@Kameshwaran
Kameshwaran / heroku-database-url-to-config.sh
Created February 7, 2019 06:39
Shell script to extract details from DATABASE URL
# Sample DATABASE_URL = dbms://username:password@hostname:port/dbname
DB_PROTOCOL=$(echo $DATABASE_URL | cut -d':' -f1)
DB_DETAILS=$(echo $DATABASE_URL | cut -d'/' -f3)
DB_NAME=$(echo $DATABASE_URL | cut -d'/' -f4)
HOST_NAME=$(echo $DB_DETAILS | cut -d'@' -f2 | cut -d':' -f1)
PORT=$(echo $DB_DETAILS | cut -d'@' -f2 | cut -d':' -f2)
USER_NAME=$(echo $DB_DETAILS | cut -d'@' -f1 | cut -d':' -f1)
PASSWORD=$(echo $DB_DETAILS | cut -d'@' -f1 | cut -d':' -f2)
@dpaola2
dpaola2 / stripe_handler.js
Created September 30, 2018 23:23
Stripe Elements and Turbolinks
function doStripe() {
if (!document.getElementById('card-element')) {
return;
}
var stripe = Stripe(window.stripe_key);
var elements = stripe.elements();
var style = {};
var card = elements.create('card', {style: style});