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
# Install rustup from https://rustup.rs/ | |
rustup toolchain add nightly # install nightly | |
cargo +nightly install racer # install racer | |
rustup component add rustfmt-preview # install rustfmt | |
rustup component add rust-src # install rust source |
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
commit "6ccb629e365f46a9516e4defeced652cce9d4d35" | |
shadow-cljs - config: /Users/will/Code/clojure/hx/shadow-cljs.edn cli version: 2.7.9 node: v10.3.0 | |
shadow-cljs - socket connect failed, server process dead? | |
shadow-cljs - starting via "clojure" | |
Dec 14, 2018 5:17:21 PM org.xnio.Xnio <clinit> | |
INFO: XNIO version 3.3.8.Final | |
Dec 14, 2018 5:17:21 PM org.xnio.nio.NioXnio <clinit> | |
INFO: XNIO NIO Implementation Version 3.3.8.Final | |
shadow-cljs - HTTP server for :workshop available at http://localhost:8700 |
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 apollo-example.core | |
(:require [hx.react :as hx :refer [defnc]] | |
["react-dom" :as rdom] | |
["react-apollo" :as apollo] | |
["apollo-boost" :default ApolloClient :refer [gql]] | |
[applied-science.js-interop :as j])) | |
(def client (ApolloClient. #js {:uri "https://48p1r2roz4.sse.codesandbox.io"})) | |
(def exchange-query (gql "{ |
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 ueaq.core | |
(:require | |
[goog.object :as gobj] | |
["react" :as r] | |
["react-dom/server" :as rds])) | |
(defn unwrap | |
[^js p] | |
(.-__unwrap p)) |
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
import { LexicalGrammar } from "./lexer"; | |
let toplevel = new LexicalGrammar(); | |
export const canonicalParens = { | |
'#?(': '()', | |
'#?@(': '()', | |
'#(': '()', | |
'(': '()', | |
')': '()', | |
'#{': '{}', | |
'{': '{}', |
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]}] |
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-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 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
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) |