Skip to content

Instantly share code, notes, and snippets.

View prestancedesign's full-sized avatar

Michael Salihi prestancedesign

View GitHub Profile
.ONESHELL:
test: .SHELLFLAGS := -i
test: SHELL := bb
test:
(println :wow)
(require '[clojure.string :as s])
(s/reverse (slurp "./Makefile"))
@roman01la
roman01la / clojurescript-repl-workflow.md
Last active October 22, 2022 12:07
ClojureScript REPL Workflow

ClojureScript REPL Workflow

Short write up on using REPL when developing UIs in ClojureScript.

Hot-reload on save or Eval in REPL?

Everyone's standard approach to hot-reloading is to use a tool (Figwheel or shadow-cljs) that reloads changed namespaces automatically. This works really well: you change the code, the tool picks up changed files, compiles namespaces and dependants, notifies REPL client which then pulls in compiled changes, and re-runs a function that re-renders UI.

The other approach is to use ClojureScript's REPL directly and rely only on eval from the editor. This more or less matches Clojure style workflow. This approach might be useful when you don't want tools overhead or hot-reloading becomes slow for you or you just used to this style of interactions. Also changing code doesn't always mean that you want to reload all the changes. On the other hand it is very easy to change a couple of top-level forms and forget to eval one of them.

@athomasoriginal
athomasoriginal / reitit-routing.cljs
Created April 15, 2020 01:50
reitit routing clojurescript
(ns ^:figwheel-hooks reitit-routing
(:require
[reagent.core :as r]
[reagent.dom :as r.dom]
[reitit.frontend :as rf]
[reitit.frontend.easy :as rfe]
[reitit.coercion.spec :as rss]
[fipp.edn :as fedn]))
;; State
@jarmitage
jarmitage / avril.tidal
Created April 14, 2020 20:37
Avril 14th
-- happy avril 14th :)))))))))))))))))))))))))))))))))))))))
do
let bars = 4
key = "8"
righthand = "[[4 -3] [0 _ _ _ _ _ 0]] [[-3, -8] [7 5 4 0]]"
lefthand = "[0 9 12 16] [4 12 16 19] [5 12 17 19] [2 12 17 16]"
d1 $ slow bars
$ stack [
n (righthand + key + "<24 36>/2"),
@iocanel
iocanel / nutrition.org
Last active February 12, 2024 03:05
Nutrition tracking with Emacs and Org Mode

Nutrition tracking using Emacs

This is not a blog post. This is my Emacs powered nutrition tracker!

No, I mean it!

It’s the one file that contains all the code, templates and data of my tracker,

#!/usr/bin/env bb
(require '[clojure.java.shell :refer [sh]])
(defn exit [error]
(println error)
(System/exit 1))
(defn open-folder [folder]
(let [folder (some-> folder (io/file))]
(when (nil? folder)
@borkdude
borkdude / sci_google_cloud.js
Last active March 1, 2020 13:21
Google cloud function running sci
const { evalString } = require("@borkdude/sci");
let printlnArgs = [];
function println(...args) {
printlnArgs.push(args.map(arg => arg.toString()).join(" "));
}
exports.evalClojureExpr = (req, res) => {
const { text } = req.body;
@cldwalker
cldwalker / spike-day-02-03-20.md
Last active December 29, 2023 04:52
GraalVM dive in Clojure at work

Spike

I looked into the state of GraalVM and Clojure and wrote some small work-related scripts.

GraalVM Build Tools

@yogthos
yogthos / clojure-beginner.md
Last active June 12, 2024 10:42
Clojure beginner resources

Introductory resources

Warning: this is just me musing and soliciting stimulating opinions. None of this may happen.

On Writing re-frame Event Handlers

Aside #1:

There should be one — and preferably only one — obvious way to do it
-- Tim Peters