First, a few dependencies:
- Leiningen: https://leiningen.org/
- Node.js & NPM: https://nodejs.org/
- Serverless: https://serverless.com/
- An active AWS account: https://aws.amazon.com/
module StringSet = Set.Make(String); | |
let arrayToStringSet = (arr) => StringSet.of_list(Array.to_list(arr)); | |
let noDuplicates = (cardinal, pass) => { | |
let phrases = Js.String.split(" ", pass); | |
cardinal(arrayToStringSet(phrases)) == Array.length(phrases) | |
}; | |
let part1 = (input) => |
module Components = { | |
module Box = { | |
let jsComponent = [%bs.raw | |
{| | |
({ children, ...props }) => React.createElement("box", props, children) | |
|} | |
]; | |
let make = (~width, ~height, ~top, ~left, children) => | |
ReasonReact.wrapJsForReason( | |
~reactClass=jsComponent, |
First, a few dependencies:
#!/usr/local/bin/zsh | |
brew tap railwaycat/emacsmacport | |
brew install emacs-mac --with-xml2 --with-ctags --with-spacemacs-icon --with-gnutls --with-natural-title-bar | |
osascript -e 'tell application "Finder" to make alias file to POSIX file "/usr/local/opt/emacs-mac/Emacs.app" at POSIX file "/Applications"' | |
# For opening from term: https://gist.github.com/railwaycat/4043945 | |
# Install spacemacs | |
git clone https://github.com/syl20bnr/spacemacs ~/.emacs.d |
(ns my-app.css | |
(:require ["emotion" :as emotion])) | |
(defn edn [& styles] | |
(apply emotion/css (map clj->js styles)) |
;;; dracula-theme.el --- Dracula Theme | |
;; Copyright 2015-present, All rights reserved | |
;; | |
;; Code licensed under the MIT license | |
;; Author: film42 | |
;; Version: 1.3.2 | |
;; Package-Version: 20180416.652 | |
;; Package-Requires: ((emacs "24")) |
;; The latest CIDER v0.18-SNAPSHOT bumped the nREPL dependency to 0.4 | |
;; which broke the sayid and clj-refactor nREPL middleware. | |
;; Here's how to disable them until they can be updated | |
(defun dotspacemacs/user-config () | |
;; ... | |
(setq sayid-inject-dependencies-at-jack-in nil) | |
(setq cljr-inject-dependencies-at-jack-in nil) | |
;; ... | |
) |
(defn project-paths [projection] | |
(loop [pr projection | |
paths '[]] | |
(let [[el next] pr] | |
(if (empty? pr) | |
paths | |
(if (vector? next) | |
(recur | |
(drop 2 pr) |
# Add these to your .bash_profile / .zshrc / etc. | |
# Starts a Clojure repl | |
function rebel-clj() { | |
clojure -Sdeps "{:deps {com.bhauman/rebel-readline {:mvn/version \"0.1.4\"} $@}}" -m rebel-readline.main | |
} | |
# Starts a browser REPL | |
function rebel-cljs() { | |
clojure -Sdeps "{:deps {com.bhauman/figwheel-main {:mvn/version \"0.1.7\"} com.bhauman/rebel-readline-cljs {:mvn/version \"0.1.4\"} $@}}" -m figwheel.main |
/** | |
Problem 1: As a library developer, I want to be able to test my hooks without having to render a component. | |
Problem 2: As a library developer, I want to be able to publish my hooks without a direct dependency on React. | |
Problem 3: As an application developer, I want to be able to easily override (with some sort of proxy/rewire magic, | |
perhaps) hooks with side effects in tests. | |
Problem 4: As an application developer, I would like to be able to use hooks written for React in other frameworks | |
that support hooks. |