Skip to content

Instantly share code, notes, and snippets.


Johan Steenkamp jsteenkamp

View GitHub Profile
mjackson / nested-ternary-jsx.js
Created Nov 2, 2016
Nested ternaries work like if/else if/else for JSX
View nested-ternary-jsx.js
const element = (
{currentPage === 'signin' ? (
) : currentPage === 'welcome' ? (
) : currentPage === 'about' ? (
) : (
teropa /
Created Sep 24, 2015
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!



paulirish /
Last active Sep 27, 2021
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.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
staltz /
Last active Sep 27, 2021
The introduction to Reactive Programming you've been missing
subudeepak / angular-loadscript-with-documentwrite.js
Last active May 5, 2020 — forked from endorama/angular-loadscript.js
Loading scripts on ngInclude (ng route) - Script loading directive
View angular-loadscript-with-documentwrite.js
* This module is a variant which supports document.write. If you need document.write use this instead
* Author: Deepak Subramanian @subudeepak(
* Distributed under MIT License
/*global angular */
(function (ng) {
'use strict';
app.directive('script', function() {
return {