Skip to content

Instantly share code, notes, and snippets.

@lencioni
lencioni / AsyncComponent.jsx
Created January 8, 2017 17:09
<AsyncComponent> at Airbnb used for Webpack code splitting
// Usage:
//
// function loader() {
// return new Promise((resolve) => {
// if (process.env.LAZY_LOAD) {
// require.ensure([], (require) => {
// resolve(require('./SomeComponent').default);
// });
// }
// });
@teropa
teropa / reactive2015_gol.md
Created September 24, 2015 15:56
ClojureScript Game of Life - Reactive 2015 Lightning Talk Proposal

In my proposed lightning talk for the Reactive Conference, I'll create Conway's Game of Life in ClojureScript, and I'll do it in five minutes. I'll use an interactive programming workflow enabled by Figwheel. Each piece will be added into the running application without reloading the page.

If you want to see a little cellular lifeform spawn out of nothing into an running web browser window, I'd appreciate it if you starred this Gist!

Cheers,

(@teropa)

@levand
levand / cider-opinions.md
Last active November 20, 2023 07:50
Why I don't use cider

Why I don't use cider.

This is all personal opinion and a matter of taste. I'm putting it here because people have asked - I'm glad Cider exists and that a lot of people are obviously using it to great effect. This is not an attack on Cider or a an attempt to negate the experience of those who like it, just my own experience.

Also some of the critiques are more properly aimed at nRepl than Cider - I don't use nRepl either, in Emacs. For some reason I have fewer issues with it in Cursive (though I still do have some).

  1. With Cider, there's too much "going on" between Emacs and Clojure. When something glitches, hangs, doesn't return a value, throws an excption, etc (as it does, multiple times a day), I don't know whether the problem is in Emacs, in the Cider client, the nRepl server, one of any of the default middlewares or in my actual program. I run Emacs in inferior lisp using lein trampoline -m clojure.main - if something goes wrong, it's either in Emacs (which is usually obvious) or my program. Mi
(ns react-cljs.core
(:require React))
(declare render)
(defn handle-change [e]
(render {:text (.. e -target -value)}))
(defn render [{:keys [text]}]
(React/renderComponent