Skip to content

Instantly share code, notes, and snippets.

View prestancedesign's full-sized avatar

Michael Salihi prestancedesign

View GitHub Profile
@hatemhosny
hatemhosny / clojurescript-reagent-scittle.markdown
Created June 2, 2023 15:31
ClojureScript Reagent (Scittle)

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
henryw374 / kroki-read.bb
Last active July 4, 2022 17:50
encode and decode files as kroki url diagrams https://kroki.io/#try
#!/usr/local/bin/bb
(import '[java.io ByteArrayOutputStream])
(import '[java.util Base64]) ;
(import '[java.util.zip Inflater]) ;
(defn uncompress [source-bytes]
(let [inflater (doto (Inflater.)
(.setInput source-bytes))
outputStream (new ByteArrayOutputStream (count source-bytes))
@borkdude
borkdude / polyglot.cljs
Created January 31, 2022 10:15
GraalVM Node + nbb + JVM Clojure
$ $GRAALVM_HOME/bin/node --jvm --polyglot --vm.cp=$(clojure -Spath) $(which nbb)
user=> (.-version js/process)
"v14.18.1"
user=> (require '["path" :as path])
nil
user=> (path/resolve ".")
"/Users/borkdude"
user=> (def Clojure (js/Java.type "clojure.java.api.Clojure"))
#'user/Clojure
user=> (def clj:require (.var Clojure "clojure.core" "require"))
(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
raspasov / reanimated-v2-for-cljs.js
Created September 4, 2021 12:24
Reanimated v2 shim for CLJS
import React, {useImperativeHandle, useRef, forwardRef} from 'react';
import Animated, {
useSharedValue,
useAnimatedStyle,
withTiming,
withSpring
} from 'react-native-reanimated';
function Box(props, ref) {
const aRef = useRef();
@didibus
didibus / clojure-right-tool.md
Last active July 10, 2024 04:30
When is Clojure "the right tool for the job"?

My answer to: https://www.reddit.com/r/Clojure/comments/pcwypb/us_engineers_love_to_say_the_right_tool_for_the/ 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
borkdude / gallery.cljs
Last active March 30, 2024 17:36 — forked from yogthos/gallery.cljs
script to download walpapers from windowsonearth.org, adapted for nbb
@borkdude
borkdude / 1) bb.edn
Last active January 25, 2023 23:52
Work bb.edn files
{:tasks {:requires ([babashka.fs :as fs])
:init (do (when (seq (fs/modified-since "deps.edn"
["deps.template.edn"
"../base/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"