This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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])) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>Using both small and large grids</h1> | |
<ul class='small-block-grid-2 large-block-grid-4'> | |
<li><img src='http://placekitten.com/g/200/220' /></li> | |
<li><img src='http://placekitten.com/g/200/200' /></li> | |
<li><img src='http://placekitten.com/g/200/280' /></li> | |
<li><img src='http://placekitten.com/g/200/250' /></li> | |
<li><img src='http://placekitten.com/g/200/240' /></li> | |
<li><img src='http://placekitten.com/g/200/270' /></li> | |
<li><img src='http://placekitten.com/g/200/230' /></li> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
A basic implementation of the Publisher/Subscriber design pattern. | |
Developed by @addyosmani and @integralist | |
Example Usage: | |
// Create subscriber function to be called when topic publishes an event | |
var testSubscriber = function (topics, data) { | |
console.log(topics + ': ' + data); | |
}; |