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 numbers = [1, 2, 3] | |
const result = numbers.reduce((acc, cur) => acc += cur, 0) | |
result //? | |
const summr = (total, addition) => total + addition | |
const myReducer = (reducerFunc, initialValue, arr) => { | |
let accumilation = initialValue |
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
These notes are for mac os. | |
Config File | |
=========== | |
Host * | |
AddKeysToAgent yes | |
UseKeychain yes | |
IdentityFile ~/.ssh/name of 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
########### | |
# Aliases # | |
########### | |
alias cra='create-react-app' |
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 { translate } from 'react-i18next' | |
jest.mock('react-i18next', () => ({ | |
t: (key: string) => key, | |
translate: () => Component => { | |
Component.defaultProps = { ...Component.defaultProps, t: () => '' } | |
return Component | |
}, | |
})) |
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
Clear device caches: | |
=================== | |
> flutter clean | |
Get packages | |
============ | |
> flutter pub get |
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
// Store original value to set back after tests | |
const previousInnerWidth = window.innerWidth | |
Object.defineProperty(window, 'innerWidth', { | |
configurable: true, | |
value: 400, | |
writable: true, | |
}) |
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 StyledImg = styled.img<StyledImgProps>` | |
position: relative; | |
` | |
// Overriding a styled component's styles | |
export const StyledIcon = styled(Img)<StyledIconProps>` | |
position: relative; | |
` |
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
// Update the value used by a view's "when" condition | |
// Can't use in getChildren() | |
vscode.commands.executeCommand('setContext', someContextVar, isVisibleBoolean); | |
// Package.json | |
/* | |
... | |
"views": { |
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
// Called when active editor language is changed: | |
// After the active editor language changes the content is "re-opened" so just listen for the open event | |
// And check the lang of the active editor | |
vscode.workspace.onDidOpenTextDocument(() => { | |
const editor = vscode.window.activeTextEditor | |
if (editor !== undefined) { | |
const { | |
document: { languageId }, | |
} = editor; |
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 interfac-e NpmContributors { | |
email?: string; | |
githubUsername?: string; | |
name: string; | |
url?: string; | |
} | |
export interface NpmMaintainer { | |
email: string; |