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
/** | |
* | |
* Late night framework experiment with @pmarabeas | |
* | |
*/ | |
'use strict'; | |
var angular = require('angular'); |
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
'use strict'; | |
let objToCsv = (function() { | |
let defaultOptions = { | |
showLabel: true, | |
lineBreak: '\r\n', | |
separator: ',' | |
}; | |
// escape quotes |
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
/** | |
* Convenience function for deep updates including searches in the path | |
*/ | |
export default function updateIn(immutableType, pathArray, updater) { | |
// pathArray can contain matcher functions | |
let failed = false; | |
let parsedPath = []; | |
pathArray.every( (pathEl, idx) => { | |
if (typeof pathEl !== 'function' && typeof pathEl !== 'object') { |
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
/** | |
* This is an insultingly simple demo due to nerd rage | |
* | |
* There are claims of people using static XOR keys to hide shell code in malware | |
* | |
* The only thing more embarrassing than this is that it supposedly prevent detection. | |
* | |
*/ | |
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
let basis = { | |
hello: (name) => console.log(`hello ${name}!`) | |
}; | |
function wrap(fn, name, ctx) { | |
return function() { | |
let args = Array.prototype.slice.call(arguments); | |
console.log(`wrapped function ${name}`, args); | |
return fn.apply(ctx, args); |
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
'use strict'; | |
function matchAll(re, str) { | |
let result = [], tmp; | |
while ( (tmp = re.exec(str)) !== null ) { | |
tmp.shift(); | |
result = result.concat(tmp); | |
} | |
return result; | |
} |
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 zipInterleaved(arr) { | |
return arr.reduce( (prev, cur, idx) => { | |
if (idx % 2 == 0) { | |
return {obj:prev, key:cur}; | |
} else { | |
let obj = prev.obj; | |
obj[prev.key] = cur; | |
return prev.obj; | |
} | |
}, {}); |
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
'use strict'; | |
var _templateObject = _taggedTemplateLiteral(['\n @media screen and (min-width: 980px){\n ', '\n }\n '], ['\n @media screen and (min-width: 980px){\n ', '\n }\n ']), | |
_templateObject2 = _taggedTemplateLiteral(['\n @media screen and (min-width: 768px) {\n ', '\n }\n '], ['\n @media screen and (min-width: 768px) {\n ', '\n }\n ']), | |
_templateObject3 = _taggedTemplateLiteral(['\n @media screen and (min-width:480px) {\n ', '\n }\n '], ['\n @media screen and (min-width:480px) {\n ', '\n }\n ']), | |
_templateObject4 = _taggedTemplateLiteral(['\n *, ::after, ::before {\n box-sizing: border-box;\n }\n\n body {\n margin: 0;\n font-family: \'myriad-pro\', sans-serif;\n color: ', ';\n -webkit-font-smoothing: antialiased;\n min-width: 320px;\n }\n\n a {\n color: ', ';\n text-decoration: none;\n\n &:hover,\n &:focus {\n text-decoration: underl |
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
'use strict'; | |
// here is where we'd bring in our glue library | |
// | |
// (this is just a placeholder for same) | |
let ADS_COMPONENT = `data-ads-component`; | |
let E_DEPENDENCY = 'Either include as an external script, or as a bundled dependency'; | |
let E_NO_REACT = 'No React found.'; |
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
import {flowRight, set} from 'lodash-fp' | |
const foo = (obj) => flowRight( | |
set('noodles', 'yes please'), | |
({a, b, c}) => { | |
console.log(a,b,c); | |
return obj | |
} | |
) |