Skip to content

Instantly share code, notes, and snippets.

@luruke
luruke / smashingmagazine.js
Last active January 17, 2025 09:55
Source code of the demo "Improving User Flow Through Page Transitions" on Smashing Magazine.
/*
https://www.smashingmagazine.com/2016/07/improving-user-flow-through-page-transitions/
You can copy paste this code in your console on smashingmagazine.com
in order to have cross-fade transition when change page.
*/
var cache = {};
function loadPage(url) {
if (cache[url]) {
@ptdecker
ptdecker / control-flow-4.js
Last active December 6, 2016 15:05
Node.js Serial Execution of an Array of Callback Functions
/* Control Flow 4 - Serial Execution of an Array of Callback Functions
*
* Based on:
* - http://book.mixu.net/node/ch7.html
* - https://github.com/mixu
*
* Revised based upon comments from 'lanzz' to use 'process.nextTick(next)' instead of 'next()'
* Revised based upon comments from 'Israel' to use "typeof(callback) != 'undefined'"
*
* The 'Array.prototype.slice.call(arguments)' usage is a JavaScript trick and explained here: