5 Cool JS Tricks To Impress Your Teammates

Illustration by loornicolas

1. Update your NPM modules with one command

$ npx npm-check-updates

2. Specify a React.js Component as PropType

3. Clean-Up local Git branches

git branch | egrep -v 'master|feat/something-neat' | xargs git branch -D
  1. git branch shows all your local branches, this gets piped to egrep
  2. egrep will return every branch that matches any identifier inside the quotes, which are separated by a |. The flag -v makes it return every branch that does not match the identifiers. This gets piped to xargs
  3. xargs passes branch names as arguments to git branch -D, which deletes the branch

4. Get a professional git history

747ef1e feat: add Button
19d9327 feat: add Navbar
effb3b4 initial commit
c2149d1 fixup! feat: add Navbar
747ef1e feat: add Button
19d9327 feat: add Navbar
effb3b4 initial commit
de1e9de feat: add Button
b3b4932 feat: add Navbar
effb3b4 initial commit

5. Quickly start your work environment (MacOS)

alias work_on="
open /Applications/Slack.app ; /
open /Applications/Mail.app ; /
open /Applications/Zeplin.app ; /
open /Applications/Postman.app ; /
"
alias work_off="
osascript -e 'quit app \"Zeplin\"' ; /
osascript -e 'quit app \"Mail\"' ; /
osascript -e 'quit app \"Code\"' ; /
osascript -e 'quit app \"Slack\"' ; /
osascript -e 'quit app \"Postman\"' ; /
"

BONUS: How to be polite with your shell

alias please="sudo"
$ please gatsby develop

Full-Stack Developer, Teacher, Maker, and general Things-Doer. https://www.linkedin.com/in/jonportella/

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Agora Release React Native SDK v3.5.2

RESTAPI Unit Testing — Mocha&Chai

Dynamic Route Matching with Vue Router

Improve Your Node.js Performance With Promise Pools

Top React Libraries — Swipes and Collapse

Best JavaScript Frameworks 2020

NativeScript Vue — Page, Progress Bar, Scroll View, and Search Bar

Chapter 8: Observable’s collection transformers operators

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Jon Portella

Jon Portella

Full-Stack Developer, Teacher, Maker, and general Things-Doer. https://www.linkedin.com/in/jonportella/

More from Medium

Moving to Medium

I need help!

Nathan’s Poem

Goddammit. I’m just trying to celebrate this victory.