I hereby claim:
- I am renarsvilnis on github.
- I am renarsvilnis (https://keybase.io/renarsvilnis) on keybase.
- I have a public key ASCqW6nmRyxAuawicthyZFzwvp-FVybO76yYRTzLcdfr7go
To claim this, I am signing this object:
| alert('Hello world!'); |
I hereby claim:
To claim this, I am signing this object:
| // ... | |
| function loggingMiddleware (req, res, next) { | |
| const id = genReqId(req) | |
| req.log = res.log = logger.child({reqId: id}) | |
| req.log[useLevel]({req}, 'Recieved request') | |
| res[startTime] = res[startTime] || Date.now() | |
| if (!req.res) { req.res = res } | |
| res.on('finish', onResFinished) |
| import {PureComponent, PropTypes} from 'react'; | |
| export default class DelayMount extends PureComponent { | |
| static propTypes = { | |
| render: PropTypes.bool.isRequired, | |
| children: PropTypes.any, | |
| transitionEnterDelay: PropTypes.number.isRequired, | |
| transitionLeaveTimeout: PropTypes.number.isRequired | |
| } |
| export function calcFitDimensions (target, boundries, upscale = false) { | |
| if (!target.width || !target.height || !boundries.width || !boundries.height) { | |
| return calcCenterPosition(target, boundries); | |
| } | |
| let imgRatio = target.width / target.height; | |
| let newWidth; | |
| let newHeight; | |
| // if image is horizontal |
| /** | |
| * ES6 way of removing nth array element in an immutable way | |
| * @param [Array] arr | |
| * @param [number] i | |
| * @return [Array] | |
| */ | |
| function removeNthEl (arr, i) { | |
| return [ | |
| ...arr.slice(0, i), | |
| ...arr.slice(i + 1) |
Curated list of useful gulp plugins for awesome and easy frontend web development.
Some tips or useful info that i found interesting or useful at the moment of writing.
USE IT EVERYWHERE. THE END.