Skip to content

Instantly share code, notes, and snippets.

@kahunamoore
kahunamoore / index.html
Created August 18, 2017 06:27 — forked from anonymous/index.html
ToDoList
<!-- Note: depends on jQuery being included via Pen Settings -->
<input id="new-todo" type="text" onkeypress="checkForEnter(event);" />
<button onclick="addToDo()" >Add</button>
<button onclick="deleteAll()">Delete All</button>
<ul id="todos"></ul>
@kahunamoore
kahunamoore / script.js
Created August 18, 2017 06:23 — forked from anonymous/script.js
StudentLookup
// Note: We would normally get this data from
// a database via an HTTP server. This is just
// example data "hard coded" here for clarity.
var alanStudent = {
id: 1234,
firstName: "Alan",
lastName: "Moore",
age: 42,
birthdate: new Date(10, 24, 1964)
@kahunamoore
kahunamoore / hope.md
Created September 30, 2016 09:00 — forked from ultimape/hope.md
Dear Internet Friend. I made this for you. It might be re-gifted, but I hope you like it anyway. #TMMTO #HOPE
@kahunamoore
kahunamoore / what-forces-layout.md
Created September 27, 2015 18:25 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout. This is also called reflow or layout thrashing, and is common performance bottleneck.

Element

Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()
(ns cljs-react-reload.core
(:require
[cljs.env :as env]))
(defmacro def-react-class [vname body & {:keys [redefine]}]
(let [vname-proxy# (symbol (str vname "-proxied"))]
(if (and env/*compiler*
(let [{:keys [optimizations]} (get env/*compiler* :options)]
(or (nil? optimizations) (= optimizations :none))))
`(do
@kahunamoore
kahunamoore / core.cljs
Last active August 29, 2015 14:24 — forked from scttnlsn/core.cljs
(ns nested-routing.core
(:require [goog.events :as events]
[goog.history.EventType :as EventType]
[reagent.core :as reagent]
[reagent.ratom :refer-macros [reaction]]
[re-frame.core :refer [dispatch dispatch-sync register-handler register-sub subscribe]]
[secretary.core :as secretary :refer-macros [defroute]])
(:import goog.History))
(declare route-components