Skip to content

Instantly share code, notes, and snippets.

View smee's full-sized avatar

Steffen Dienst smee

View GitHub Profile
;;=============== play with flow ==============
(require '[clojure.core.async :as async]
'[clojure.core.async.flow :as flow]
'[clojure.pprint :as pp]
'[clojure.datafy :as d])
(set! *warn-on-reflection* true)
(defn monitoring [{:keys [report-chan error-chan]}]
(prn "========= monitoring start")
@panzi
panzi / export_local_storage.js
Created March 6, 2024 18:51
Bookmarklets to export/import localStorage. Import does *not* clean localStorage, only sets the loaded values.
// bookmarklet:
// javascript:(function()%7Bconst%20blob%3Dnew%20Blob(%5BJSON.stringify(localStorage)%5D%2C%7Btype%3A'application%2Fjson'%7D)%3Bconst%20link%3Ddocument.createElement('a')%3Bconst%20url%3DURL.createObjectURL(blob)%3Blink.href%3Durl%3Blink.download%3D'local_storage.json'%3Blink.style.display%3D'none'%3Bdocument.body.appendChild(link)%3Blink.click()%3BsetTimeout(()%3D%3E%7BURL.revokeObjectURL(url)%3Bdocument.body.removeChild(link)%3B%7D%2C250)%3B%7D)()%3B
function exportLocalStorage(){
const blob = new Blob([JSON.stringify(localStorage)],{type:'application/json'});
const link = document.createElement('a');
const url = URL.createObjectURL(blob);
link.href = url;
link.download = 'local_storage.json';
link.style.display='none';
document.body.appendChild(link);
@noone2k
noone2k / bc2500-ble-idf.yaml
Last active April 16, 2026 11:52
bc2500 info/control with esphome
bin dann auch erstmal wech ...
gibt hier wieder einen, der ein ungutes gefühl verbreitet und das muss ich mir nicht antun.
wenn ich auf hassprediger stehen würde, würde ich bsw, afd oder den IS wählen 😁
abgesehen davon, ist das hier sogut wie abgeschlossen und ich bin nicht hierauf angewiesen 😁
vllt später nochmal öffnen, falls ich doch mal wieder nen antreib/grund finde ... 😁
abschließend verweise ich noch auf folgendes:
@flamewave000
flamewave000 / mount_win11_fs_on_wsl2.md
Last active March 30, 2026 08:33
Mount Windows 11 Home Folders on WSL2 for Better Performance

Mount Windows 11 Home Folders on WSL2 for Better Performance

The Problem: WSL2 and Windows Files BAD

The reason I have wandered down this road is that the one reson I always stuck with WSL1 is its filesystem performance when working with files on the windows system.

I recently decided to jump to WSL2 due to some of its many features, but was horribly hampered by just how slow it was to interact with Windows files. A lot of my development is for Android and I run Android Studio on my computer but interact with the repo using WSL to manage Git and to sometimes run the Unit Tests. When I switched to WSL2, git ground to a halt. I was seeing typically everything taking 10x more time to complete. Running git status in WSL1 would take 0.5s or less. In WSL2 it takes 6.5 seconds on average, or 23+ seconds if it had to reindex the 1549 files in the project, which only tooke WSL1 about 2.7 seconds to complete previously.

My First Attempt with NFS

@rutenkolk
rutenkolk / upgrade_zig.clj
Created September 16, 2021 22:35
upgrading zig to the latest version with Babashka
#!/usr/bin/env bb
(ns script
(:require [clojure.java.io :as io]
[clojure.string :as s]
[clojure.pprint :as pprint]
[clojure.java.shell :refer [sh with-sh-dir]]
[cheshire.core :as json]))
(defn prsh
([sh]
@holyjak
holyjak / http-server.bb
Last active May 20, 2025 08:49
Babashka HTTP server for serving static files, similar to `python -m http.server` but more flexible :)
#!/usr/bin/env bb
#_" -*- mode: clojure; -*-"
;; Based on https://github.com/babashka/babashka/blob/master/examples/image_viewer.clj
(ns http-server
(:require [babashka.fs :as fs]
[clojure.java.browse :as browse]
[clojure.string :as str]
[clojure.tools.cli :refer [parse-opts]]
[org.httpkit.server :as server]
@henrik42
henrik42 / clojurescript-on-a-microcontroller.md
Last active April 21, 2024 18:53
Clojurescript auf einem Microcontroller

ClojureScript auf einem Mikrocontroller

Vor einiger Zeit haben ich den HuCon-Roboter-Bausatz erhalten. Der HuCon wird mit Blockly und Python programmiert. Ich programmiere schon lange auf PCs (vor allem Java und Clojure), aber mit Microcontrollern habe ich nur wenig Erfahrung. Als erstes habe ich mich mit der Installation von OpenWrt

@ericnormand
ericnormand / 00 Digit search.md
Last active December 21, 2022 00:45
399 - PurelyFunctional.tv Newsletter

Digit search

This is one of those weird programming puzzles with no real point except practice. But it's considered Very Hard in JavaScript. Let's see how we do in Clojure.

Write a function that takes a sequence of integers. You're trying to get all 10 digits by looking through the numbers sequentially. When you have found one instance of every decimal digit, return whatever number you were on when you found the last one. If you get to the end of the sequence without finding all the digits (for instance, maybe there was no 9), then just return nil.

Example

(digit-search [5175 4538 2926 5057 6401 4376 2280 6137]) ;=> 5057
DROP TABLE IF EXISTS pgbench_generic_log;
CREATE TABLE pgbench_generic_log (
mtime timestamptz not null default now(),
action char not null check (action in ('I', 'U', 'D')),
username text not null,
table_name text not null,
row_data jsonb not null
);
CREATE INDEX ON pgbench_generic_log USING brin (mtime);
@cldwalker
cldwalker / spike-day-02-03-20.md
Last active June 19, 2024 04:24
GraalVM dive in Clojure at work

Spike

I looked into the state of GraalVM and Clojure and wrote some small work-related scripts.

GraalVM Build Tools