๐
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
import { useEffect, useRef } from 'react'; | |
export const useWhatCausedRender = (name, props) => { | |
const prevPropsRef = useRef({}); | |
useEffect(() => { | |
const changes = []; | |
const prevProps = prevPropsRef.current; | |
const keySet = new Set([...Object.keys(prevProps), ...Object.keys(props)]); | |
keySet.forEach((key) => { |
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
type Maybe<T> = T | null | undefined; | |
/** | |
* ะะพะทะฒะพะปัะตั ะฟะตัะตะพะฟัะตะดะตะปะธัั ัะธะฟ ัะฒะพะนััะฒะฐ {PropertyName} ั ัะธะฟะฐ {T} ะฝะฐ ะฝะพะฒะพะต ะทะฝะฐัะตะฝะธะต {NewValue} | |
*/ | |
type Override<T, PropertyName extends keyof T, NewValue> = Omit<T, PropertyName> & | |
{ [K in keyof T]: K extends PropertyName ? NewValue : T[K] }; | |
interface FixedLengthArray<T extends unknown, L extends number> extends Array<T> { |
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 clone = <O extends unknown | unknown[]>(value: O, history?: Set<unknown>): O => { | |
if (value == null || typeof value !== "object") return value; | |
const stack = history || new WeakSet(); | |
if (stack.has(value)) { | |
return value; | |
} | |
stack.add(value); |
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
// Problem Statement : | |
// Write a function called deepClone which takes an object and creates a copy of it. | |
// e.g. {name: "Paddy", address: {town: "Lerum", country: "Sweden"}} -> {name: "Paddy", address: {town: "Lerum", country: "Sweden"}} | |
// Solution | |
// This file shows ability of multiple approach with their advantages and disadvantages and 2 fully tested and working approach. | |
// One has been written by me and another has been received from community to showcase that self written code is more concise and readable. | |
// Just run this file in Node Js environment to get the result. | |
// To run test cases, un comment method named test() in the bottom of file |
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
# Amazon | |
13.125.0.0/16 | |
13.56.0.0/14 | |
13.230.0.0/15 | |
18.130.0.0/16 | |
18.144.0.0/16 | |
18.184.0.0/15 | |
18.194.0.0/15 | |
18.196.0.0/15 |
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
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "Example", | |
"type": "node", | |
"request": "launch", | |
"runtimeExecutable": "node", | |
"runtimeArgs": ["--nolazy", "-r", "ts-node/register/transpile-only"], |
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
import {Action, ActionCreator, Dispatch} from 'redux'; | |
import {ThunkAction} from 'redux-thunk'; | |
// Redux action | |
const reduxAction: ActionCreator<Action> = (text: string) => { | |
return { | |
type: SET_TEXT, | |
text | |
}; | |
}; |
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
{ | |
"content_scripts": [ | |
{ | |
"matches": ["http://*/*", "https://*/*"], | |
"js": ["inject.js"], | |
"all_frames": true | |
} | |
], | |
"web_accessible_resources": [ | |
"content.js" |
EMOJI CHEAT SHEET
Emoji emoticons listed on this page are supported on Campfire, GitHub, Basecamp, Redbooth, Trac, Flowdock, Sprint.ly, Kandan, Textbox.io, Kippt, Redmine, JabbR, Trello, Hall, plug.dj, Qiita, Zendesk, Ruby China, Grove, Idobata, NodeBB Forums, Slack, Streamup, OrganisedMinds, Hackpad, Cryptbin, Kato, Reportedly, Cheerful Ghost, IRCCloud, Dashcube, MyVideoGameList, Subrosa, Sococo, Quip, And Bang, Bonusly, Discourse, Ello, and Twemoji Awesome. However some of the emoji codes are not super easy to remember, so here is a little cheat sheet. โ Got flash enabled? Click the emoji code and it will be copied to your clipboard.
People
๐
NewerOlder