Skip to content

Instantly share code, notes, and snippets.

View PEZ's full-sized avatar
🎯
Focusing

Peter Strömberg PEZ

🎯
Focusing
View GitHub Profile
@PEZ
PEZ / dumdom_defcomponent_macro.clj
Created February 18, 2024 09:37
A workaround to make default linting resolve `dumdom.core/defcomponent` without complaints.
(ns my-dumdom.macros
(:require [dumdom.core :as dumdom]))
(defn- extract-docstr
[[docstr? & forms]]
(if (string? docstr?)
[docstr? forms]
["" (cons docstr? forms)]))
(defn- extract-opts
@PEZ
PEZ / config.edn
Created February 18, 2024 08:06
A clj-kondo hook for Dumdom components `.clj-kondo/hooks/dumdom.clj`
{:linters {:dumdom/component-options {:level :warning}}
:hooks {:analyze-call {dumdom.core/defcomponent hooks.dumdom/defcomponent}}}
@PEZ
PEZ / starship.toml
Last active May 27, 2023 12:06
A mainly git focused starship config
# The longest config I have ever written to get something minimal.
# I only want:
# 1. an unabberiviated path
# 2. the git branch, status, commit, state
# 3. The newline.
# Rationale for this approach:
# I like a lot of the default format, so don't want to override it by default.
[directory]
disabled=false
@PEZ
PEZ / long-classpath-string.txt
Last active January 18, 2023 21:05
VS Code lookahead regex match mystery
"env/dev/clj:env/dev/cljs:env/dev/resources:test/clj:test/cljs:env/test/resources:src/clj:src/cljs:src/cljc:resources:/Users/pez/.m2/repository/binaryage/devtools/1.0.6/devtools-1.0.6.jar:/Users/pez/.m2/repository/breaking-point/breaking-point/0.1.2/breaking-point-0.1.2.jar:/Users/pez/.m2/repository/buddy/buddy-hashers/1.8.158/buddy-hashers-1.8.158.jar:/Users/pez/.m2/repository/camel-snake-kebab/camel-snake-kebab/0.4.3/camel-snake-kebab-0.4.3.jar:/Users/pez/.m2/repository/cider/cider-nrepl/0.28.5/cider-nrepl-0.28.5.jar:/Users/pez/.m2/repository/clj-http/clj-http/3.12.3/clj-http-3.12.3.jar:/Users/pez/.m2/repository/clj-statecharts/clj-statecharts/0.1.5/clj-statecharts-0.1.5.jar:/Users/pez/.m2/repository/clj-time/clj-time/0.15.2/clj-time-0.15.2.jar:/Users/pez/.m2/repository/clout/clout/2.2.1/clout-2.2.1.jar:/Users/pez/.m2/repository/com/github/seancorfield/honeysql/2.2.891/honeysql-2.2.891.jar:/Users/pez/.m2/repository/com/taoensso/nippy/3.1.3/nippy-3.1.3.jar:/Users/pez/.m2/repository/com/taoensso/tempura/1.3.0
flf2a$ 6 4 6 -1 4
3x5 font by Richard Kirk (rak@crosfield.co.uk).
Ported to figlet, and slightly changed (without permission :-})
by Daniel Cabeza Gras (bardo@dia.fi.upm.es)
@
@
@
@
@
@PEZ
PEZ / rebob - rebase branch on branch
Last active March 10, 2022 17:18
Zsh functions to help rebasing git branches safely
# Previous branch is `baz`
~/Foo(bar|✔) % rebobl -
logging to: /var/folders/t5/gqxhj8pd6p9_tnvy6sbtmy480000gn/T/rebob.YJJZirAY
rebob: No branch given, checking REBOBS in /Users/pez/.my-configs/rebob_config.zshrc
rebob: rebob /Users/pez/Foo:bar on -
rebob: pulling?: false
rebob: Created: .rebobing
Saved working directory and index state WIP on bar: 17fa37c Add baz
rebob: Stashed -u (.rebobing stashed)
Current branch bar is up to date.
"paste-replaced.replacers": [
[ // hostname/path -> Markdown url
[".*", "[$&](https://$&)"],
],
[ // Clojure namespace -> file path segment
["\\.", "/", "g"],
["-", "_", "g"],
],
[ // Love bomb, anything -> 💪♥️♥️♥️♥️♥️♥️💪
[".", "♥️", "g"],
@PEZ
PEZ / rich4clojure_elementary_problem_005.clj
Last active September 6, 2021 16:48
Lists: conj – Rich 4Clojure Problem 5 – See: https://github.com/PEZ/rich4clojure
(ns rich4clojure.elementary.problem-005
(:require [hyperfiddle.rcf :refer [tests]]))
;; = Lists: conj =
;; By 4Clojure user: dbyrne
;; Difficulty: Elementary
;;
;; When operating on a list, the conj function will return
;; a new list with one or more items "added" to the front.
;;
@PEZ
PEZ / rich4clojure_medium_problem_195.clj
Last active July 25, 2021 16:58
Parentheses... Again – Rich 4Clojure Problem 195 – See: https://github.com/PEZ/rich4clojure
(ns rich4clojure.medium.problem-195
(:require [hyperfiddle.rcf :refer [tests]]))
;; = Parentheses... Again =
;; By 4Clojure user: djtrack16
;; Difficulty: Medium
;; Tags: [math combinatorics]
;;
;; In a family of languages like Lisp, having balanced
;; parentheses is a defining feature of the language.
@PEZ
PEZ / rich4clojure_medium_problem_177.clj
Last active April 11, 2023 15:53
Balancing Brackets – Rich 4Clojure Problem 177 – See: https://github.com/PEZ/rich4clojure
(ns rich4clojure.medium.problem-177
(:require [hyperfiddle.rcf :refer [tests]]))
;; = Balancing Brackets =
;; By 4Clojure user: daowen
;; Difficulty: Medium
;; Tags: [parsing]
;;
;; When parsing a snippet of code it's often a good idea
;; to do a sanity check to see if all the brackets match