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 {assign} = Object; | |
const pipe = (fn, ...fns) => (param, ...staticArgs) => fns.reduce((acc, f) => f(acc), fn(param, ...staticArgs)); | |
const compose = (...fns) => pipe(...fns.reverse()); | |
const pipeAsync = (fn, ...fns) => (param, ...staticArgs) => fns.reduce((acc, f) => acc.then(_ => f(_, ...staticArgs)), fn(param, ...staticArgs)); | |
const composeAsync = (...fns) => pipeAsync(...fns.reverse()); | |
const apply = (...fns) => (...args) => fns.map(fn => fn(...args)); | |
const curry = (fn, ...args) => (fn.length <= args.length) ? fn(...args) : (...more) => curry(fn, ...args, ...more); | |
const match = (guard) => (left = _ => _, right = _ => _) => (...args) => (..._) => guard(...args) ? right(..._, ...args) : left(..._, ...args); | |
const extract = (_) => (...methods) => methods.reduce((acc, method) => assign(acc, {[method]: (...args) => _[method](...args)}), {}); |
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
export const simple = { | |
method: (param) => { | |
return `my param: ${param}` | |
} | |
}; | |
export const shorter = { | |
method(param1) { | |
return `my param1: ${param1}` | |
} |
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 path = require("path") | |
module.exports = { | |
/* Your site config here */ | |
siteMetadata: { | |
title: "Generic Site Title", | |
}, | |
pathPrefix: `/gby1`, | |
plugins: [ | |
`gatsby-transformer-sharp`, |
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
/** | |
* Original idea: https://github.com/necolas/normalize.css/tree/master | |
* Added box-sizing based on https://css-tricks.com/box-sizing/ | |
**/ | |
/** | |
* 1. Correct the line height in all browsers. | |
* 2. Prevent adjustments of font size after orientation changes in iOS. | |
*/ |
OlderNewer