This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
current_dir=$(pwd) | |
# make directory to hold node_modules | |
read -ra hash <<< "$(pwd | shasum)" # get hash of current path | |
modules_dir="$HOME/.nbb/_modules/${hash[0]}" | |
mkdir -p "$modules_dir" | |
# install node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Skeletyl self source cost | |
5x each PCB from JLCPCB: 33.46 + 20.13 = 53.59 | |
Digikey | |
Flex strips x 30 = 47.48 | |
Diode x 100 = 17.70 | |
Neopixel LED x 70 = 20.65 | |
330 Ohm resistor x 20 = 2.66 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns helix.util.html) | |
(require | |
'[clojure.data.xml :as xml] | |
'[clojure.walk :as walk]) | |
(import '[clojure.data.xml Element]) | |
(defn html->dom |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; An example usage of an imaginary `iteration-async` API, which uses | |
;; continuation passing to signal when to continue to the next page, | |
;; completion, and failure | |
(defn fetch-pages-async | |
"Fetches summary pages repeatedly until no pages are left. | |
Calls `done` callback when complete. Calls `err` if an error occurs." | |
([done err url] | |
(fetch-summaries done err url 0)) | |
([done err url page] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns lilactown.template | |
#?(:cljs (:require-macros [lilactown.template]))) | |
(defn- interleave* | |
"A version of interleave that continues to build the lazy seq even if one of | |
the coll has no elements left" | |
([] ()) | |
([c1] (lazy-seq c1)) | |
([c1 c2] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function useCutoff(x, cutoff) { | |
// track each value of x between renders | |
let xPrev = useRef(x); | |
useEffect(() => { xPrev.current = x }, [x]); | |
// if the cutoff function returns true, render the previously returned value. | |
// else, synchronously schedule render withnew state value | |
let [ret, setRet] = useState(x); | |
if (!cutoff(xPrev.current, x)) { | |
setRet(x) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns eff.global-scope | |
(:import | |
(java.lang Continuation ContinuationScope))) | |
(let [effect-scope (ContinuationScope. "effect") | |
state (atom 0) | |
;; track what effect is currently being performed, | |
;; and what we're going to return | |
effect-performing (atom nil) | |
effect-returning (atom nil) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns helix-three.core | |
(:require [goog.object :as gobj] | |
[helix.core :refer [defnc $]] | |
[helix.hooks :as hooks] | |
[cljs-bean.core :as b] | |
["react-dom" :as rdom] | |
["react-three-fiber" :as rtf]) | |
(:refer-clojure :exclude [Box])) | |
(defnc Box [props] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns helix-context-memo | |
(:require [helix.core :refer [defnc $ <>]] | |
[helix.dom :as d] | |
[helix.hooks :as hooks] | |
["react-dom" :as rdom] | |
["react" :as react])) | |
(def global-state-context (react/createContext {})) | |
(def GlobalStateProvider (.-Provider global-state-context)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns helix-example | |
(:require | |
[helix.core :refer [defnc $ <>]] | |
[helix.hooks :as hooks] | |
[helix.dom :as d] | |
["react-dom" :as rdom])) | |
(defnc Greeting | |
"A component which greets a user. The user can double click on their name to edit it." | |
[{:keys [name on-name-change]}] |
NewerOlder