npm v3.10 - ◾
If you are learning npm then i would suggest to go for yarn, dont waste your time in learning npm
npm install -g npm
# Downgrade to a specific version
# [UPDATE] | |
# Its no longer complicated! Yay! | |
# Install Glassit Linux VSCode Extension | |
# then install this: | |
sudo apt install -y wmctrl x11-utils bash | |
# then restart VSCode. Done! |
git branch --merged master | grep -v "\master" | xargs -n 1 git branch -d |
// great for fixtures used in tests that need to stay up to date | |
// needs moment.js | |
const moment = require('moment') | |
const updateTimestamps = (entity, baseTimestamp, path = '', tsFields) => { | |
// usage: recusrively updates all Timestamps in a json fixture for tests | |
const nowTs = moment().clone().startOf('hour') | |
const diff = Math.abs(nowTs.diff(baseTimestamp, 'hours')) |
[alias] | |
recent = "!r(){ git for-each-ref --sort=-committerdate refs/heads --format='%(HEAD)%(color:yellow)%(refname:short)|%(color:bold green)%(committerdate:relative)|%(color:blue)%(subject)|%(color:magenta)%(authorname)%(color:reset)' --color=always|column -ts'|'; }; r" |
# ./my_script.sh --arg1 value1 --arg2 value2 --arg3 value3 | |
# ./my_script.sh -a value1 -b value2 -c value3 | |
#!/usr/bin/env bash | |
while [[ "$#" -gt 0 ]]; do case $1 in | |
-a|--arg1) var1="$2"; shift;; | |
-b|--arg2) var2="$2"; shift;; | |
-c|--arg3) var3="$2"; shift;; | |
*) echo "Unknown parameter passed: $1"; exit 1;; | |
esac; shift; done |
# Export the vars in .env into your shell: | |
export $(egrep -v '^#' .env | xargs) |
for i in $( ls | grep [A-Z] ); do mv -i $i `echo $i | tr 'A-Z' 'a-z'`; done |
docker run -p 8000:8000 amazon/dynamodb-local -jar DynamoDBLocal.jar -sharedDb |
# start nodeenv virtual env if it exists | |
# for whenever you open integrated terminal in vscode | |
if [ -d ".nenv" ]; then | |
. ".nenv/bin/activate" | |
fi |
If you are learning npm then i would suggest to go for yarn, dont waste your time in learning npm
npm install -g npm
# Downgrade to a specific version