A Pen by Michael SALIHI on CodePen.
Thank you, Sean Corfield!
clj -Ttools install io.github.seancorfield/deps-new '{:git/tag "v0.4.13"}' :as new
#!/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)) |
- https://github.com/stuartsierra/component
- https://github.com/tolitius/mount
- https://github.com/weavejester/integrant
- https://github.com/donut-power/system Mixes code+config in same structure
- https://github.com/juxt/clip Mixes code+config in same structure
$ $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" |
import React, {useImperativeHandle, useRef, forwardRef} from 'react'; | |
import Animated, { | |
useSharedValue, | |
useAnimatedStyle, | |
withTiming, | |
withSpring | |
} from 'react-native-reanimated'; | |
function Box(props, ref) { | |
const aRef = useRef(); |
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:
(ns spacedl.spacedl | |
(:require [clojure.string :as string :refer [join starts-with?]])) | |
(.on js/process "uncaughtException" #(js/console.error %)) | |
(defonce http (js/require "http")) | |
(defonce https (js/require "https")) | |
(defonce fs (js/require "fs")) | |
(defn page [gallery-url page-number] |
{: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" |