This file contains hidden or 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
| { | |
| "name": "", | |
| "version": "1.0.0", | |
| "description": "", | |
| "main": "server.js", | |
| "scripts": { | |
| "lint": "eslint .", | |
| "pretest": "npm run lint", | |
| "test": "babel-node ./node_modules/.bin/blue-tape ./test/**/*.spec.js | faucet", | |
| "cover": "babel-node node_modules/.bin/babel-istanbul cover node_modules/.bin/tape ./lib/*.js --report html --dir ./test/coverage", |
This file contains hidden or 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
| 'use strict'; | |
| module.exports = function findParent(childElement, parentNodeSelector) { | |
| while (childElement && childElement.parentNode !== document) { | |
| if (childElement.hasAttribute(parentNodeSelector) || childElement.className.indexOf(parentNodeSelector) > -1) { | |
| return childElement; | |
| } | |
| childElement = childElement.parentNode; | |
| } | |
| return null; |
This file contains hidden or 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
| 'use strict'; | |
| var mediaQuery = function() { | |
| var _queries = {}; | |
| var getMediaQueries = function getMediaQueries() { | |
| var metaTags = document.querySelectorAll('meta[data-breakpoint]'); | |
| var metaArr = [].slice.call(metaTags); | |
| var key; |
This file contains hidden or 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
Show hidden characters
| { | |
| "preset": "google", | |
| "fileExtensions": [ ".js", "jscs" ], | |
| "requireParenthesesAroundIIFE": true, | |
| "maximumLineLength": 120, | |
| "validateLineBreaks": "LF", | |
| "validateIndentation": 4, | |
| "disallowKeywords": ["with"], |
This file contains hidden or 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
| const logger = R.compose( | |
| R.bind(console.log, console), | |
| R.concat('Missing selector '), | |
| R.flip(R.identity) | |
| ); | |
| const mapCb = (x) => console.log(x.textContent); | |
| const mapper = R.map(mapCb); |
This file contains hidden or 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
| var h = require('virtual-dom/h'); | |
| var createElement = require('virtual-dom').create; | |
| var BoxHook = function(){}; | |
| BoxHook.prototype.hook = function(elem, key, previousValue) { | |
| console.log('Hello from ' + elem.id + '!\nMy key was: ' + key); | |
| }; | |
| var properties = { | |
| attributes: { |
This file contains hidden or 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
| var most = require('most'); | |
| var xInput = document.querySelector('input.x'); | |
| var yInput = document.querySelector('input.y'); | |
| var resultNode = document.querySelector('.result'); | |
| var internals = {}; | |
| internals.add = function add(x, y) { | |
| return x + y; | |
| }; |
This file contains hidden or 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
| 'use strict'; | |
| var R = require('ramda'); | |
| var sinon = require('sinon'); | |
| var log = {}; | |
| log.warning = R.bind(console.warn, console); | |
| sinon.stub(log, 'warning'); | |
| var args = 'this is a test'; |
This file contains hidden or 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
| var $input = document.getElementById('term'); | |
| var $results = document.getElementById('results'); | |
| var keyups = Rx.Observable | |
| .fromEvent($input, 'keyup') | |
| .map(function(e) { | |
| $results.innerHTML = ''; | |
| return e.target.value; | |
| }) | |
| .filter(function(text) { |
This file contains hidden or 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
| var Rx = require('rx'); | |
| var R = require('ramda'); | |
| var seq = Rx.Observable.range(1, 10); | |
| var isEven = function isEven(x) { return x % 2 === 0; }; | |
| var add1 = function add1(x) { return x + 1; }; | |
| var transducer = R.compose(R.map(add1), R.filter(isEven)); | |
| var source = seq.transduce(transducer); |
OlderNewer