Skip to content

Instantly share code, notes, and snippets.


Michael Salihi prestancedesign

View GitHub Profile

Link to deps-new github.

Thank you, Sean Corfield!

Commands from the video

Install deps-new:

clj -Ttools install io.github.seancorfield/deps-new '{:git/tag "v0.4.13"}' :as new

henryw374 /
Last active July 4, 2022 17:50
encode and decode files as kroki url diagrams
(import '[ ByteArrayOutputStream])
(import '[java.util Base64]) ;
(import '[ Inflater]) ;
(defn uncompress [source-bytes]
(let [inflater (doto (Inflater.)
(.setInput source-bytes))
outputStream (new ByteArrayOutputStream (count source-bytes))
borkdude / polyglot.cljs
Created January 31, 2022 10:15
GraalVM Node + nbb + JVM Clojure
View polyglot.cljs
$ $GRAALVM_HOME/bin/node --jvm --polyglot --vm.cp=$(clojure -Spath) $(which nbb)
user=> (.-version js/process)
user=> (require '["path" :as path])
user=> (path/resolve ".")
user=> (def Clojure (js/Java.type ""))
user=> (def clj:require (.var Clojure "clojure.core" "require"))
View guestbook.clj
(ns guestbook
(:require [cheshire.core :as cheshire]
[hiccup2.core :as hiccup]
[clojure.string :as str]))
(require '[babashka.pods :as pods])
(pods/load-pod "./pod-babashka-postgresql")
(def db {:dbtype "postgresql"
:user "guestbook"
raspasov / reanimated-v2-for-cljs.js
Created September 4, 2021 12:24
Reanimated v2 shim for CLJS
View reanimated-v2-for-cljs.js
import React, {useImperativeHandle, useRef, forwardRef} from 'react';
import Animated, {
} from 'react-native-reanimated';
function Box(props, ref) {
const aRef = useRef();
didibus /
Last active January 31, 2023 19:13
When is Clojure "the right tool for the job"?

My answer to: which asked to know when and at what is Clojure "the right tool for the job"?

My take is that in general, the right tool for the job actually doesn't matter that much when it comes to programming language.

There are only a few cases where the options of tools that can do a sufficiently good job at the task become limited.

That's why they are called: General-purpose programming languages, because they can be used generally for most use cases without issues.

Let's look at some of the dimensions that make a difference and what I think of Clojure for them:

borkdude / gallery.cljs
Last active August 2, 2022 15:42 — forked from yogthos/gallery.cljs
script to download walpapers from, adapted for nbb
View gallery.cljs
borkdude / 1) bb.edn
Last active January 25, 2023 23:52
Work bb.edn files
View 1) bb.edn
{:tasks {:requires ([babashka.fs :as fs])
:init (do (when (seq (fs/modified-since "deps.edn"
(shell {:dir ".."} "script/gen-deps.clj")))
;; Maintenance tasks
install {:doc "Install frontend dependencies from NPM"
:task (shell "npm install")}
clean {:doc "Clean all artifacts"
View bb_droplet_snapshot.clj
;; script for creating DigitalOcean's droplet snapshot
(require '[babashka.curl :as curl])
(require '[cheshire.core :as json])
(def token (System/getenv "DO_TOKEN"))
(def droplet-id (System/getenv "DO_DROPLET_ID"))
(when (not token)