I hereby claim:
- I am karudo on github.
- I am karudo (https://keybase.io/karudo) on keybase.
- I have a public key ASCYrHhqzxNabbqGeLJlNH7_hdA2UArdEXMncX4mIymhzwo
To claim this, I am signing this object:
| type ExtractObj<S extends object, K> = K extends keyof S ? S[K] : never | |
| type Path<S extends object, T extends readonly unknown[]> = | |
| T extends readonly [infer T0, ...infer TR] | |
| ? TR extends [] | |
| ? ExtractObj<S, T0> extends never | |
| ? readonly [] | |
| : readonly [T0] | |
| : ExtractObj<S, T0> extends object | |
| ? readonly [T0, ...Path<ExtractObj<S, T0>, TR>] |
| /** | |
| * Deep diff between two object, using lodash | |
| * @param {Object} object Object compared | |
| * @param {Object} base Object to compare with | |
| * @return {Object} Return a new object who represent the diff | |
| */ | |
| function difference(object, base) { | |
| function changes(object, base) { | |
| return _.transform(object, function(result, value, key) { | |
| if (!_.isEqual(value, base[key])) { |
| import { | |
| EditorState, | |
| ContentBlock, | |
| genKey | |
| } from 'draft-js'; | |
| import { List, Map } from 'immutable'; | |
| export const getSelectionRange = () => { | |
| const selection = window.getSelection(); |
| const getEditorState = this.props.store.getItem('getEditorState'); | |
| const setEditorState = this.props.store.getItem('setEditorState'); | |
| const selection = this.props.store.getItem('lastSelection'); | |
| const editorState = getEditorState(); | |
| const updateSelection = new SelectionState({ | |
| anchorKey: selection.anchorKey, | |
| anchorOffset: selection.anchorOffset, | |
| focusKey: selection.anchorKey, | |
| focusOffset: selection.focusOffset, | |
| isBackward: false, |
| import React, { useContext } from 'react'; | |
| import { PWRouterContext } from './context'; | |
| class MyClassComponent extends React.Component { | |
| static contextType = PWRouterContext; | |
| render() { | |
| const { | |
| routeName, // e.g. 'groupApplicationPermissions' | |
| branch, // e.g [{name: 'root', path: 'v2'}, {name: 'aplicationsIndex', path: 'applications'}] |
| //----------------------------------*\ | |
| // TRIGONOMETRY FUNCTIONS | |
| //----------------------------------*/ | |
| // # Trigonometry in CSS | |
| // | |
| // - Through Taylor/Maclaurin polynomial representation: http://people.math.sc.edu/girardi/m142/handouts/10sTaylorPolySeries.pdf | |
| // - Useful if you don't want to use JS. | |
| // - With CSS Variables. | |
| // - `calc()` can't do power (x ^ y) so I used multiplication instead. |
| const VERSION = self.LENTA_SW_VERSION; | |
| const CACHE_FILES = [ | |
| '/assets/offline/index.html', | |
| '/assets/offline/offline.css', | |
| '/assets/offline/vendors.js', | |
| '/assets/offline/offline.js', | |
| '/assets/offline/offline.sprite.svg', | |
| '/assets/offline/fonts/pt_sans-bold.woff2', | |
| '/assets/offline/fonts/pt_sans-regular.woff2', | |
| '/assets/offline/fonts/pt_sans-caption-regular.woff2', |
| const HtmlWebpackPlugin = require('html-webpack-plugin') | |
| module.exports = { | |
| configureWebpack: { | |
| plugins: [new HtmlWebpackPlugin({ | |
| filename: 'test.html', | |
| excludeChunks: ['app'] | |
| })], | |
| entry: { | |
| app2: './src/app2.js' | |
| } |
I hereby claim:
To claim this, I am signing this object: