MacOS · Technical · Today I Learned

Terminal Commands to Improve Productivity on Mac

Open any IntelliJ Idea editor from current folder. (Change PhpStorm to your editro’s name)

open -a PhpStorm ./

GIT – Reset uncommitted changes and files

git reset --hard && git clean -fd

Sublime Text – Create a CLI launcher

ln -s "/Applications/Sublime" ~/bin/subl

Save Aliases

If you don’t want to remember these, you can add these to your ~/.bashrc or ~/.zshrc file.

# edit hosts file
alias edithosts='subl /etc/hosts'

# reset git folder
alias nah='git reset --hard && git clean -fd'

# open current folder in idea editor
alias storm='open -a PhpStorm .'

# clear DNS history
alias cleardns='sudo killall -HUP mDNSResponder'

# NPM install
alias ni='npm install'

After you update ~/.bashrc or ~/.zshrc, run the applicable command in terminal to load the changes.

source ~/.bashrc
// OR
source ~/.zshrc
MacOS · Today I Learned

Monosnap for Mac won’t Start? Here’s How to Fix

Monosnap is a great tool to take screenshots and annotate for Mac and Windows. With MacOS updates, sometimes it may not start. You can try reinstalling it, but it may not solve the problem.

Then you need to try removing all files created from it.

Open Terminal in Mac, and run these commands.

rm -rf ~/Library/Application\ Scripts/com.monosnap.monosnap
rm -rf ~/Library/Containers/com.monosnap.monosnap
rm -rf ~/Library/Application\ Scripts/com.monosnap.MonosnapLauncher

If you need to see if any crash reports were generated, run this.

ls ~/Library/Application\ Support/CrashReporter/Monosnap_*.plist

To delete the crash reports,

rm ~/Library/Application\ Support/CrashReporter/Monosnap_*.plist

After that, reinstall Monosnap, and the icon should showup in your menubar.