Skip to content

Instantly share code, notes, and snippets.

View refset's full-sized avatar
🌍

Jeremy Taylor refset

🌍
View GitHub Profile
@eneroth
eneroth / rama_electric.clj
Last active September 8, 2023 15:39
Rama + Electric
;; ## General helpers
(ns app.helpers.rama
(:require
[missionary.core :as m]
[taoensso.timbre :as timbre])
(:import
[com.rpl.rama Depot PState Path ProxyState$Callback RamaModule]
[com.rpl.rama.test InProcessCluster LaunchConfig]
[hyperfiddle.electric Failure Pending]))
@jarohen
jarohen / rafting.clj
Last active September 12, 2023 16:12
A quick hack at actually implementing the Raft algorithm to aid my learning - thanks @bbengfort and @krisajenkins for the podcast!
(ns rafting
(:require [clojure.tools.logging :as log])
(:import java.lang.AutoCloseable
(java.util.concurrent CompletableFuture Executors TimeUnit)))
(defn new-timeout-ms []
(+ (System/currentTimeMillis)
200
(rand-int 150)))
@bsless
bsless / README.md
Created August 31, 2023 12:44
Clojure app startup performance

Why

Simple experiment to test the effects of different techniques and options on application start up time

Class Data Sharing (CDS)

The goal of CDS is to reduce the startup time of the JVM by loading from a pre-processed archive of Java classes and JVM metadata that is used during the initialization process. https://dev.java/learn/jvm/cds-appcds/

Clojure compiler options

see

Meta elision

@joshcho
joshcho / reactive_render.cljc
Last active January 5, 2024 06:02
Delight, Generating Interactive Controls over Electric Code
;; This is free and unencumbered software released into the public domain.
;;
;; Anyone is free to copy, modify, publish, use, compile, sell, or
;; distribute this software, either in source code form or as a compiled
;; binary, for any purpose, commercial or non-commercial, and by any
;; means.
;;
;; In jurisdictions that recognize copyright laws, the author or authors
;; of this software dedicate any and all copyright interest in the
;; software to the public domain. We make this dedication for the benefit
@tggreene
tggreene / checkpoint_gc.clj
Created June 14, 2022 16:28
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
@tggreene
tggreene / tampermonkey-scittle.js
Created April 5, 2022 10:46
TamperMonkey Scittle
// ==UserScript==
// @name <name>
// @namespace http://tampermonkey.net/
// @version 0.1
// @description <description>
// @author You
// @match <match>
// @require https://cdn.jsdelivr.net/npm/[email protected]/dist/scittle.js
// @resource cljs file:///path/to/some.cljs
// @grant GM_getResourceText
@nivekuil
nivekuil / scylla.clj
Last active March 16, 2021 23:37
crux scylla/cassandra doc store
(ns app.crux.scylla
(:require [crux.codec :as codec]
[crux.db]
[crux.document-store :as ds]
[crux.io :refer [with-nippy-thaw-all]]
[crux.system :as sys]
[crux.memory]
[taoensso.nippy :as nippy]
[taoensso.timbre :as log]
[qbits.alia :as alia]
@spacegangster
spacegangster / user.clj
Last active March 24, 2022 12:16
Getting call graph (vars structure) in Clojure
(ns user)
; Hey, I've been playing a bit with graphing out the structure of a module for Lightpad.
; It worked well, I've found the target function that I'll need change to add a new feature.
; Tweet with a screenshot https://twitter.com/spacegangster/status/1324760381735272450
; lein coordinate
; [com.gfredericks/clj-usage-graph "0.3.0"]
; https://github.com/gfredericks/clj-usage-graph
@KGOH
KGOH / convert.clj
Last active February 29, 2024 12:12
convert.clj -- babashka edn/json/yaml to edn/json/yaml converter
#!/usr/bin/env bb
;; convert.clj -- babashka edn/json/yaml to edn/json/yaml converter
;; Author: github.com/KGOH/
;; Source: gist.github.com/KGOH/50c0f66022fea2ac173518a143238058
;; Version: 2020.4
; Usage example:
; In Emacs: i.imgur.com/TIEDmga.mp4
; $ convert.clj edn <<< '{"foo": "bar"}'
; {:foo "bar"}
@dvingo
dvingo / crux-pull.clj
Created May 5, 2020 16:22
pull api support for crux
(ns datascript-crux.pull-api
(:require
[crux.api :as crux]
[datascript.pull-parser :as dpp]
[my-app.crux-node :refer [crux-node]])
(:import [datascript.pull_parser PullSpec]))
;; lightly adapted from:
;; https://github.com/tonsky/datascript/blob/master/src/datascript/pull_api.cljc
;; https://github.com/tonsky/datascript/blob/master/src/datascript/pull_parser.cljc