Skip to content

Instantly share code, notes, and snippets.

View picheli20's full-sized avatar
🐟
Deep diving into open source code

Fabio Picheli picheli20

🐟
Deep diving into open source code
View GitHub Profile
@usergenic
usergenic / npm_import.bash
Last active May 6, 2022 13:01
npm link sucks because symlinks and node_modules, so i use this instead
# Given a single argument, being the folder to a local copy of the npm package to "install"
# copy it to the local node_modules folder, then make sure it has no node_modules of its own.
# This way you can npm install locally afterwards to cover remaining dependencies and
# everything will work right.
function npm_import {
export pkgname=`basename $1`
export pkgdir="node_modules/$pkgname"
if [ -d "$pkgdir" ]; then
rm -rf "$pkgdir"
fi
@nasirkhan
nasirkhan / git command.markdown
Last active May 12, 2022 03:17
`git` discard all local changes/commits and pull from upstream

git discard all local changes/commits and pull from upstream

git reset --hard origin/master

git pull origin master