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 function assertNever(value: never): never { | |
| throw new Error(`Unexpected value: ${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
| Use git log --diff-filter=D --summary to get all the commits which have deleted files and the files deleted; | |
| Use git checkout $commit~1 path/to/file.ext to restore the deleted file. | |
| Where $commit is the value of the commit you've found at step 1, e.g. e4cf499627 |
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, EffectCallback, DependencyList, | |
| } from 'react'; | |
| export const useDidUpdateEffect = (callback: EffectCallback, deps: DependencyList) => { | |
| const didMount = useRef(false); | |
| useEffect(() => { | |
| if (didMount.current) { | |
| callback(); |
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
| #!/bin/bash | |
| set -eu | |
| TARGET="/home/YOUR_PROJECT/deploy-folder" | |
| GIT_DIR="/home/YOUR_PROJECT/project.git" | |
| BRANCH="master" | |
| while read oldrev newrev ref | |
| do | |
| # only checking out the master (or whatever branch you would like to deploy) |
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
| #!/bin/bash | |
| set -eu | |
| TARGET="/home/YOUR_PROJECT/deploy-folder" | |
| GIT_DIR="/home/YOUR_PROJECT/project.git" | |
| BRANCH="master" | |
| while read oldrev newrev ref | |
| do | |
| # only checking out the master (or whatever branch you would like to deploy) |
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
| If you have an issue, when you can't change resolution of the MacOS installed in the VMWare even after VMWare tools has been installed. | |
| In my case it was not applyable resolution change. I had 1024x768 by default and when I tried to change it to 1600x900, etc. and got | |
| resolution jump and back to 1024x768 | |
| You may set any supported by your device custom resoultion. | |
| Just run following command in MacOS Terminal and you will be happy :) | |
| /Library/Application\ Support/VMware\ Tools/vmware-resolutionSet 1920 1080 | |
| NOTES: |
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
| # This command will parse all your local branched that had been merged instead of master or dev. Then for each branch will be called git branch -d(delete locally) | |
| git branch --merged | egrep -v "(^\*|master|dev)" | xargs git branch -d |
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
| // Delete all local branches, that were merged to master | |
| git branch --merged | grep -v "\*" | xargs -n 1 git branch -d |
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
| alias ags="git status" | |
| alias aga="git add *" | |
| alias agg="git pull" | |
| alias agp="git push" | |
| alias agc="git commit -m" | |
| alias agnb="git checkout -b" | |
| alias agcb="git checkout" | |
| alias ani="sudo npm i" | |
| alias anc="sudo npm-check” |