Upgrade all dependencies to the latest version within you workspace
yarn upgrade-interactive --latest
| const getKey = args => JSON.stringify(args) | |
| const callAndSave = cache => callback => async (...args) => { | |
| const value = await callback(...args) | |
| cache[getKey(args)] = { // eslint-disable-line no-param-reassign | |
| timestamp: Date.now(), | |
| value, | |
| } |
| git branch -vv | awk '{print $1}' | grep -Ev 'HEAD|master|*' | xargs git branch -d --force |
| const crypto = require('crypto') | |
| const toMD5 = object => crypto.createHash('md5').update(JSON.stringify(object)).digest('hex') | |
| module.exports = ({ | |
| timeout = (/* 1 h */ 1 * 60 * 60 * 1000), | |
| maxEntries = 100, | |
| name = 'cache', | |
| log = console.log, | |
| } = {}) => { |
| git branch -vv | awk '{print $1}' | grep -v HEAD | grep -v master | grep -v '*' | xargs git branch -d --force |
| /* eslint-env jest */ | |
| // init avec default data | |
| // 100 SET d'un tableau de 1000 | |
| // 100 ADD | |
| // 100 UPDATE | |
| // 100 ADD_OR_UPDATE | |
| // 100 REMOVE | |
| // <time> | |
| // 1000 de chaque selector | |
| const { keyValue } = require('.') |
| const update = (entity, delta) => { | |
| const { body } = entity | |
| // move using `setPosition` and scale it with time since `setVelocity` doesn't scale with time (yet ?) | |
| Body.setPosition( | |
| body, | |
| Vector.add( | |
| body.position, | |
| Vector.mult( | |
| { x: 1, y: 0 }, |
Upgrade all dependencies to the latest version within you workspace
yarn upgrade-interactive --latest
| import React, { Component } from 'react'; | |
| import withMouseTracker from './withMouseTracker' | |
| class Timeline extends Component { | |
| render() { | |
| console.log(this.props.mouseTracker) | |
| return ( | |
| <div | |
| className="timeline" | |
| ref={this.props.trackerRef} |
| import { useState } from 'react' | |
| const useRandom = (min = 0, max = Number.MAX_SAFE_INTEGER) => { | |
| const [value, setValue] = useState(undefined) | |
| const rand = () => { | |
| setValue(Math.floor(Math.random() * max) + min) | |
| } | |
| if (value === undefined) rand() |