Skip to content

Instantly share code, notes, and snippets.


Eirik L. Vullum eiriklv

View GitHub Profile
marick /
Last active Jun 19, 2021
About Those Lava Lamps

Around 2006-2007, it was a bit of a fashion to hook lava lamps up to the build server. Normally, the green lava lamp would be on, but if the build failed, it would turn off and the red lava lamp would turn on.

By coincidence, I've actually met, about that time, (probably) the first person to hook up a lava lamp to a build server. It was Alberto Savoia, who'd founded a testing tools company (that did some very interesting things around generative testing that have basically never been noticed). Alberto had noticed that people did not react with any urgency when the build broke. They'd check in broken code and go off to something else, only reacting to the breakage they'd caused when some other programmer pulled the change and had problems.

brentvatne /
Last active Apr 30, 2018
React.js Conf Contest

React.js Conf tickets, everyone wants them but we only have space for 400 people, and that includes speakers, organizers and everyone’s proud parents and grandparents! If you are into speaking and have time before December 13th, you should submit a 30 minute talk or 5 minute lightning talk proposal. If you’re more into writing than speaking or coding, ReactJSNews is giving away 1 ticket for the best blog post submission. But you probably like programming, so React Native Newsletter & Exponent are giving away two tickets for the best React Native apps made with Exponent! Of course, if you like speaking, writing and programming you should do all of the above.

Details of the contest

  • You make an “app” and publish it to Exponent. You don’t have to open source it, but people
scottwrobinson / brain-mnist.js
Created Dec 7, 2015
Brain.js example for training and testing on MNIST data
View brain-mnist.js
var brain = require('brain');
var fs = require('fs');
var getMnistData = function(content) {
var lines = content.toString().split('\n');
var data = [];
for (var i = 0; i < lines.length; i++) {
var input = lines[i].split(',').map(Number);
alexanderGugel / ied-0.1.0
Created Nov 16, 2015
ied-0.1.0 vs npm-2.14.7 vs npm-3.4.0
View ied-0.1.0
├── node_modules
│   ├── 00963d697b2adf0c185c4e04e73174ba9b288eb2
│   │   ├── node_modules
│   │   │   └── xml-escape -> ../../00963d697b2adf0c185c4e04e73174ba9b288eb2/package
│   │   └── package
│   │   ├── LICENSE
│   │   ├──
│   │   ├── index.js
│   │   ├── package.json

@kangax's ES6 quiz, explained

@kangax created a new interesting quiz, this time devoted to ES6 (aka ES2015). I found this quiz very interesting and quite hard (made myself 3 mistakes on first pass).

Here we go with the explanations:

Question 1:
(function(x, f = () => x) {
davideast / SyncPath.js
Last active Apr 20, 2021
Firebase Social Network Client Fanout
View SyncPath.js
export class SyncPath {
constructor(rootRef, path) {
this._rootRef = rootRef;
this.user = this._rootRef.getAuth();
this._userDataRef = this._rootRef.child(path).child(this.user.uid); = {};
this._userDataRef.on('value', (snap) => = snap.val() || {});
keys() {
return Object.keys(;
gaearon / slim-redux.js
Last active Nov 27, 2021
Redux without the sanity checks in a single file. Don't use this, use normal Redux. :-)
View slim-redux.js
function mapValues(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
result[key] = fn(obj[key], key);
return result;
}, {});
function pick(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
if (fn(obj[key])) {
paulirish /
Last active Nov 29, 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
aulizko / server.es6.js
Last active Sep 8, 2015
SSR with react-router@1.0.0-beta4
View server.es6.js
// That variant actually works with 1.0.0-beta4
// Link to the previous (1.0.0-beta3) version:
import createLocation from 'history/lib/createLocation';
import createHistory from 'history/lib/createMemoryHistory';
import ReactDOM from 'react-dom/server';
import {Router} from 'react-router';
import Layout from './views/Layout';
import Application from './containers/Application';
paulirish /
Last active Nov 24, 2021
How to view-source of a Chrome extension

Option 1: Command-line download extension as zip and extract

extension_id=jifpbeccnghkjeaalbbjmodiffmgedin   # change this ID
curl -L -o "$" "$extension_id%26uc" 
unzip -d "$extension_id-source" "$"

Thx to crxviewer for the magic download URL.