Skip to content

Instantly share code, notes, and snippets.

@ikappaki
ikappaki / say-one-thing.clj
Last active December 17, 2024 06:42
pipecat-ai 01-say-one-thing in Basilisp
(import asyncio aiohttp os sys)
(defmacro import-from
"Helper function to import each name in NAMES from MODULE as a local
variable, allowing them to be referenced without the module name.
https://github.com/basilisp-lang/basilisp/issues/1154."
[module & names]
(let [defs (for [n (vec (map str names))]
`(def ~(symbol n) (importing-resolve (symbol ~(str module "/" n)))))]
@ikappaki
ikappaki / gist:6958e8d7689eb916a887d78be93b0b87
Created February 26, 2023 13:56
nrepl-ci-win-support tls_test.clj bad-keys test failure while running on Unix, java 11, clj 1.10
ref: https://app.circleci.com/pipelines/github/ikappaki/nrepl/41/workflows/cb0e7270-eec2-4e59-b33b-242b98b957c5/jobs/154
exception in thrown? is not SocketException, thus test failure
(is (thrown? SocketException
(-> (nrepl/message client {:op "eval"
:code "(+ 1 1)"})
first
nrepl/read-response-value
:value)))
@ikappaki
ikappaki / table_userland_clipboard_copy.clj
Created March 7, 2022 20:00
Attempt to enhance clerk table-viewer from userland
(ns table-uland-cp-copy
"A first attempt of a userland hack to enhance the current
table-viewer with a copy icon on the top right corner, than when
clicked it will copy the table contents to the clipboard.
Part of a study suggested by @mkvlr to see how far one can go with
implementing a viewer in userland and the difficulties they could
face."
(:require [nextjournal.clerk :as c]
[nextjournal.clerk.viewer :as v]
@ikappaki
ikappaki / issue-eldev-circleci-cider-test-output-boot.log
Created February 19, 2022 09:33
circleci cider test failure while bootstrapping Eldev
eldev -dtT -p test
Bootstrapping Eldev for Emacs 27.2 from MELPA Stable...
[00:01.343] Started up on Tue Feb 15 20:17:44 2022
[00:01.343] Running on GNU Emacs 27.2 (build 1, x86_64-w64-mingw32)
of 2021-03-26
[00:01.343] Project directory: `c:/Users/circleci/project/'
[00:01.343] No file `c:/Users/circleci/AppData/Roaming/.eldev/config', not applying user-specific configuration
@ikappaki
ikappaki / fs.cljc
Last active November 28, 2021 23:27
bb MS-windows ext auto support patch test feedback
(defn which
"Locates a program in (exec-paths) similar to the which Unix command.
On Windows it tries to resolve in the order of: .com, .exe, .bat,
.cmd."
([program] (which program nil))
([program opts]
(let [has-ext? (extension program)]
(loop [paths (babashka.fs/exec-paths)
results []]
(if-let [p (first paths)]