Skip to content

Instantly share code, notes, and snippets.

💨 💨

Enzzo souenzzo

💨 💨
View GitHub Profile
mfikes /
Last active Apr 5, 2021
Example of foreign library property namespace

Example using library property namespace with a foreign lib:

clj -M -m cljs.main -co co.edn -re node -r
ClojureScript 1.10.844
cljs.user=> (require '[yq$yowza :as yz :refer [getMessage]])
cljs.user=> (getMessage)
"Hello, world!"
cljs.user=> (yz/sayHello "hola")
yogthos /
Last active Nov 22, 2021
some facts about USSR

Russia went from a backwards agrarian society where people travelled by horse and carriage to being the first in space in the span of 40 years. Russia showed incredible growth after the revolution that surpassed the rest of the world:

USSR provided free education to all citizens resulting in literacy rising from 33% to 99.9%:

borkdude / sci_google_cloud.js
Last active Mar 1, 2020
Google cloud function running sci
View sci_google_cloud.js
const { evalString } = require("@borkdude/sci");
let printlnArgs = [];
function println(...args) {
printlnArgs.push( => arg.toString()).join(" "));
exports.evalClojureExpr = (req, res) => {
const { text } = req.body;
borkdude / http-socket-server.clj
Last active May 3, 2021 — forked from souenzzo/http-socket-server.clj
tiny http server via java sockets in babashka
View http-socket-server.clj
#!/usr/bin/env bb
(import ( ServerSocket))
(require '[clojure.string :as string] '[ :as io])
(with-open [server-socket (new ServerSocket 8080)
client-socket (.accept server-socket)]
(loop []
(let [out (io/writer (.getOutputStream client-socket))
in (io/reader (.getInputStream client-socket))
borkdude / js_parser.clj
Last active Jun 30, 2020
Parse JavaScript in Clojure using the Google Closure Compiler
View js_parser.clj
"exec" "clojure" "-Sdeps" "{:deps {org.clojure/clojurescript {:mvn/version \"1.10.520\"}}}" "$0" "$@"
;; running js_parser.clj "function foo(x) { var y = x + 1; }" will print:
;; [{:type :function, :name "foo", :body [{:variable-statement [{:lvalue "y", :initializer {:type :binary-op, :left "x", :operator "+", :right "1"}}]}], :params ["x"]}]
View error
Error building classpath. Failed to read artifact descriptor for com.datomic:ion:jar:0.9.28
org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for com.datomic:ion:jar:0.9.28
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.readArtifactDescriptor(
at clojure.lang.MultiFn.invoke(
kennyjwilli /
Last active Nov 9, 2018
Delete leftover Datomic resources

Delete Leftover Datomic Cloud Resources

If you delete a Datomic Cloud system, it will leave some resources in AWS. To entirely delete all resources created by Datomic Cloud, you must follow these steps. Because we love automation, this script performs all these steps for you so you don't need to navigate the AWS Console UI.


gfredericks / frobnicate.clj
Last active Mar 1, 2019
Self-contained clojure file with deps
View frobnicate.clj
#!/usr/bin/env bash
#! top-of-file comments can be written using more #! lines, which
#! is a valid comment in both clojure and bash
":";# alternately this works too
#! The construction below uses cross-language syntactic hackery to
#! specify the -Sdeps arg in a part of the file that's interpreted
#! by clojure as clojure syntax (i.e., not a line comment), so it
mfikes /
Last active Aug 5, 2021
Testing perf of GraalVM version of Google Closure Compiler for ClojureScript cljs.core
git clone
cd clojurescript

Ctrl-C when it logs

Applying optimizations :advanced to 344 sources
mhuebert /
Last active Aug 24, 2020
material-ui's CSS-in-JS with Reagent. (see

material-ui allows for customizing CSS via a higher-order component called withStyles. Like many higher-order components which expect render props, the purpose of withStyles is to accept some parameters, and then introduce a new variable into the scope of the component tree.

One succinct and simple way to translate the concept of scope into Clojure is via a custom let macro. Usage of such a macro is demonstrated here:

(:require [material-ui.styles :as m])

(m/let [{:keys [leftPad]} {:leftPad 
                           {:paddingLeft 8}}]
 ;; `leftPad` is now the _className_ associated with {:paddingLeft 8}