Skip to content

Instantly share code, notes, and snippets.

Avatar

Johan Steenkamp jsteenkamp

View GitHub Profile
@mjackson
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 = (
<div>
{currentPage === 'signin' ? (
<SignInPage/>
) : currentPage === 'welcome' ? (
<WelcomePage/>
) : currentPage === 'about' ? (
<AboutPage/>
) : (
<DefaultPage/>
@teropa
teropa / reactive2015_gol.md
Created Sep 24, 2015
ClojureScript Game of Life - Reactive 2015 Lightning Talk Proposal
View reactive2015_gol.md

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)

@paulirish
paulirish / what-forces-layout.md
Last active Dec 2, 2020
What forces layout/reflow. The comprehensive list.
View what-forces-layout.md

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
View essential-javascript-links.md
@staltz
staltz / introrx.md
Last active Dec 2, 2020
The introduction to Reactive Programming you've been missing
View introrx.md
@subudeepak
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(https://github.com/subudeepak)
* Distributed under MIT License
*/
/*global angular */
(function (ng) {
'use strict';
app.directive('script', function() {
return {
You can’t perform that action at this time.