Skip to content

Instantly share code, notes, and snippets.

@realgenekim
realgenekim / deps.edn
Last active June 10, 2025 21:18
create plotly graph from clojurecreate plotly from clojure, using libpython-clj
{:paths ["src"]
:deps {org.clojure/clojure {:mvn/version "1.11.1"}
clj-python/libpython-clj {:mvn/version "2.026"}}
:aliases
{:dev {:jvm-opts ["--enable-native-access=ALL-UNNAMED"]}}}
@realgenekim
realgenekim / electric-clojure-v3-context.txt
Created January 18, 2025 18:40
All Electric Clojure v3 tutorial sample apps in one file, to easily copy/paste into Claude context
./forms_inline.cljc:
(ns electric-tutorial.forms-inline ; used in form_explainer
(:require #?(:clj [datascript.core :as d])
[hyperfiddle.electric3 :as e]
[hyperfiddle.electric-dom3 :as dom]
[hyperfiddle.electric-forms3 :as forms :refer
[Input! Checkbox! Checkbox* Form! Service try-ok effects*]]
[dustingetz.trivial-datascript-form :refer
[#?(:clj ensure-conn!) #?(:clj transact-unreliable)]]))
@realgenekim
realgenekim / hyperfiddle.cljc
Last active August 12, 2024 22:06
Getting hyperfiddle RCF working in CLJS (Fulcro app)
(ns com.example.hyperfiddle
(:require
[hyperfiddle.rcf]
[taoensso.timbre :as log]))
; wait to enable tests until after app namespaces are loaded
(defn rcf-enable []
(hyperfiddle.rcf/enable!))
@realgenekim
realgenekim / example.clj
Created November 6, 2023 21:07
Simple example of using wkok/openai-clojure library in streaming mode
(ns openai.a01-async-openai
(:require
[com.fulcrologic.guardrails.core :refer [>defn >defn- >def | ? =>]]
[wkok.openai-clojure.api :as api]
[openai.companies :as companies]
[diehard.core :as dh]
[clojure.data.json :as json]
[clojure.edn :as edn]
[clojure.spec.alpha :as s]
[clojure.core.async :as a :refer [<!! >!! <! >!]]
@realgenekim
realgenekim / wiring-winning-org-prompt.md
Last active November 4, 2023 18:12
Prompt I've been using on OpenAI GPT-4 and GPT3.5, and Claude 2. Maybe I'll put into a separate repo, because I'm modifying it all the time.

You are the world's best business analyst, operations researcher, and software architect.

Gene Kim (co-author of "Phoenix Project," "DevOps Handbook, etc.) and Steve Spear (author of "High Velocity Edge" and "Decoding the DNA of the Toyota Production System") wrote a new book together: "Wiring the Winning Organization."

In this book, they describe three mechanism:

  • Slowification: problem-solving is pulled back from fast-paced operations to more deliberate planning and practice (e.g., tabletop exercises, simulation, paper prototypes, fire drills, disaster recovery drills, Netflix Chaos Monkey). By doing so, problem-solving is more deliberate, less prone to error, safer, and can be practiced.

  • Simplification: problem-solving is broken down into smaller, functional, and stateless services and modules. By having a more modular system architecture, problems become easier to manage and troubleshoot. Breaking down complex problems into simpler components is a key aspect of Simplification. There ar

@realgenekim
realgenekim / gist:b83a378dbe4a7ca91fb67adfd14908f7
Created October 20, 2023 04:21
tampermonkey script for Piwaa: messaging for linkedin: put in keyboard accelerator to archive message
// ==UserScript==
// @name Piwaa: Linkedin Messages: keyboard accelerators
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Script to accept all the follow requests
// @author You
// @match https://app.piwaa.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=linkedin.com
// @grant none
// ==/UserScript==
@realgenekim
realgenekim / gist:0234c5dd6ad093f57fa9b885f2bd5cd3
Created October 19, 2023 04:55
Expensify tampermonkey script: highlight in pink the comment field (not very visible), and certain expense categories
// ==UserScript==
// @name Highlight Expensify comment fields and dropdown boxes set to certain values
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://www.expensify.com/expenses
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant none
// ==/UserScript==
@realgenekim
realgenekim / compact-report-control.cljc
Last active January 14, 2023 20:43
Custom compact report layout that puts pagination control into the first row, between the report title and control buttons
(ns com.example.ui.custom-report-control
(:require
#?@(:cljs
[[com.fulcrologic.fulcro.dom :as dom :refer [div]]
[com.fulcrologic.semantic-ui.addons.pagination.ui-pagination :as sui-pagination]]
:clj
[[com.fulcrologic.fulcro.dom-server :as dom :refer [div]]])
[clojure.string :as str]
[com.fulcrologic.fulcro.components :as comp]
[com.fulcrologic.fulcro-i18n.i18n :refer [tr trc]]
@realgenekim
realgenekim / does-titles.titles.clj
Last active October 6, 2022 03:09
These are selected portions of the code to do the analysis presented here: Analysis Of DevOps Enterprise Summit Speaker Titles (2014-2022): http://itrevolution.com/speaker-titles
; I'll post entire repo of how to use this analysis code, but I wanted to get something
; up right away
;
(ns does-titles.titles
(:require
[better-cond.core :as b]
[clojure.string :as str]
[clojure.test :refer :all]
[com.fulcrologic.guardrails.core :refer [>defn >defn- >def | ? =>]]))
(ns com.example.state-machines.incrementally-loaded-report-gk
;(ns com.fulcrologic.rad.state-machines.incrementally-loaded-report
"Gene modifications to incrementally-loaded-report --
This has the same interface as the 'incrementally-loaded-report' UISM included in RAD.
https://github.com/fulcrologic/fulcro-rad/blob/develop/src/main/com/fulcrologic/rad/state_machines/incrementally_loaded_report.cljc
However, instead of rendering only after the resolver resturns the entire data set,
it renders immediately after the first load completes, and use df/load! to asynchronously load