Skip to content

Instantly share code, notes, and snippets.

View refset's full-sized avatar
🌍

Jeremy Taylor refset

🌍
View GitHub Profile
@refset
refset / update-reconsidered-1977.md
Created May 2, 2025 14:10
update-reconsidered-1977.md

In 1977, Ben-Michael Schueler published a paper titled "Update Reconsidered" in "Architecture and Models in Data Base Management Systems", the proceedings of the IFIP Working Conference on Data Base Management.

Update Reconsidered

Following the year 1347 B.C., when Amenophis IV died, a mass update of a large Egyptian Data Base was undertaken. Every record pertaining to Aton was erased with hammer and chisel throughout the country. We shall call updating of records on the ground that a truth valid up to a certain point in time becomes untrue, an Aton-Update.

In the year 47 B.C., the most important Data Base of that time, the library of Alexandria was updated by a fire, leaving most of the 700,000 book scrolls as a cinder. We shall call this kind of update an Alexandria-Update (whether through fire or other causes).

From ancient times through and culminating in the Middle Ages, books made of vellum and other recording media were reused by scraping of old writing - such as the Iliad or Euclid's Elements -

@refset
refset / prompt.py
Created December 24, 2024 12:44
prompt.py
#!/usr/bin/env python3
import os
import subprocess
import sys
import tkinter as tk
class AnimatedTextApp:
def __init__(self, root, title="Animated Text"):
self.root = root
@refset
refset / answer.sql
Created December 1, 2024 21:04
adventofsql-2024-day1
SELECT
c.name,
(wl.wishes).first_choice AS primary_wish,
(wl.wishes).second_choice AS backup_wish,
(wl.wishes).colors[1] AS favorite_color,
LENGTH((wl.wishes).colors) AS color_count,
CASE
WHEN tc.difficulty_to_make = 1 THEN 'Simple Gift'
WHEN tc.difficulty_to_make = 2 THEN 'Moderate Gift'
WHEN tc.difficulty_to_make >= 3 THEN 'Complex Gift'
@refset
refset / xtsql.py
Created March 12, 2024 14:35
xtsql.py
#!/usr/bin/env python3
# MIT License
# Copyright (c) 2023-2024 Håkan Råberg and Steven Deobald
# Copyright (c) 2024 JUXT Ltd
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
(defn relate [& pairs]
(assert (even? (count pairs)) "relate requires an even number of arguments")
(->> pairs
(partition 2)
(map (fn [[k vs]] (map #(hash-map k %) vs)))
(apply map merge)))
(defn matches-specmap? [specmap m]
(reduce-kv
@refset
refset / explore_datafy_nav.clj
Created December 30, 2022 12:49 — forked from sashton/explore_datafy_nav.clj
Clojure datafy/nav exploration
(ns explore-datafy-nav
"Sample code demonstrating naving around a random graph of data.
The graph very likely will have circular references, which is not a problem.
To see the results, execute the entire file.
Each step in the nav process will be printed out, as well as the initial db.
Subsequent executions will generate a new random db."
(:require [clojure.datafy :refer [datafy nav]]))
(defn generate-db
"Generate a random database of users and departments.
@refset
refset / checkpoint_gc.clj
Created June 14, 2022 16:29 — forked from tggreene/checkpoint_gc.clj
Retain N Checkpoints
(ns excel.api.s3
(:require [cognitect.aws.client.api :as aws]
[integrant.core :as ig]
[clojure.tools.logging :as log]))
(defmethod ig/init-key ::client
[_ _]
(create-s3-client))
;; Code below may end up being a periodic background process for limiting s3
@refset
refset / flames_repl.clj
Created May 18, 2022 13:17 — forked from sw1nn/flames_repl.clj
Repl fns to generate a flame graph. (Not super sophisticated!)
;; Assumes https://github.com/jstepien/flames available
;; requires http://riemann.io to be installed.
(def flames (atom nil))
(defn flames-start! []
;; We resolve explicitly here, to avoid warnings when not working
;; with flamegraphs
(if-not @flames
(let [config {:port 54321, :host "localhost"}]
(reset! flames ((requiring-resolve 'flames.core/start!) config))
@refset
refset / get-current-pid.clj
Last active August 1, 2021 17:55
get-current-pid.clj
(-> (java.lang.management.ManagementFactory/getRuntimeMXBean)
(.getName)
(clojure.string/split #"@")
(first))