Skip to content

Instantly share code, notes, and snippets.

View forberg's full-sized avatar
🏠
Working from home

Mads Erik Forberg forberg

🏠
Working from home
View GitHub Profile
const json = require('./frd.json');
const {
appointments,
timeslots,
} = json;
appointments.forEach(({ start, end }) => console.log(start, end));
timeslots.forEach(({ start, end }) => console.log(start, end));
@forberg
forberg / visibly.js
Last active September 9, 2015 14:45 — forked from juanmhidalgo/visibly.js
Cross-browser Page Visibility API polyfill
/*!
* isVis - v0.5.6 Sep 2012 - Page Visibility API Polyfill
* Copyright (c) 2011 Addy Osmani
* Dual licensed under the MIT and GPL licenses.
*/
/*
* Firefox support added based on https://developer.mozilla.org/en-US/docs/DOM/Using_the_Page_Visibility_API
* @juanmhidalgo
*/
@forberg
forberg / introrx.md
Last active August 29, 2015 14:23 — forked from staltz/introrx.md

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called Reactive Programming, particularly its variant comprising of Rx, Bacon.js, RAC, and others.

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

@forberg
forberg / introrx.md
Last active August 29, 2015 14:23 — forked from staltz/introrx.md

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called Reactive Programming, particularly its variant comprising of Rx, Bacon.js, RAC, and others.

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

@forberg
forberg / visibly.js
Last active August 29, 2015 14:22 — forked from addyosmani/visibly.js
/*!
* isVis - v0.5.5 Aug 2011 - Page Visibility API Polyfill
* Copyright (c) 2011 Addy Osmani
* Dual licensed under the MIT and GPL licenses.
*/
(function () {
window.visibly = {
b: null,
q: document,
<div class="fb-comments" data-href="http://developers.facebook.com/docs/plugins/comments/" data-numposts="5" data-colorscheme="light"></div>
if (!document.querySelectorAll) {
document.querySelectorAll = function (selectors) {
var style = document.createElement('style'), elements = [], element;
document.documentElement.firstChild.appendChild(style);
document._qsa = [];
style.styleSheet.cssText = selectors + '{x-qsa:expression(document._qsa && document._qsa.push(this))}';
window.scrollBy(0, 0);
style.parentNode.removeChild(style);
@forberg
forberg / keybase.md
Created April 23, 2014 15:09
keybase.md

Keybase proof

I hereby claim:

  • I am forberg on github.
  • I am forberg (https://keybase.io/forberg) on keybase.
  • I have a public key whose fingerprint is 3701 7F5E 0B32 3DAE 8B5E B524 E135 0751 5E0B 1264

To claim this, I am signing this object: