Set of dotfiles for node developers
npm install devdotIn short, it is something about configuration. For example, you can assign scripts into your .bash_profile to show your current git status and branching information inside your bash terminal. You will save a lot of time if you can have those information without any effort. Of course, there are more.
- OSX User
- Development using Node.js
- Development with Atom
You can toggle your preferred settings:
# Disable the sound effects on boot
sudo nvram SystemAudioVolume=" "
# Disable smart dashes as they’re annoying when typing code
# defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false
It is very common nowadays to use git. We simplify the git config in the following as example:
[branch]
autosetuprebase = always
autosetupmerge = always
[apply]
# Detect whitespace errors when applying a patch
whitespace = fix
[alias]
logs = log --oneline --decorate
merged = branch --merged
not-merged = branch --no-merged
contributors = shortlog --summary --numbered
rb = !sh -c \"git rebase -i HEAD~$1\"
clean-fixed = !sh -c \"git branch --merged | grep fix/ | grep -v \\* | xargs -n 1 git branch -d\"
push-gerrit = !sh -c \"git push origin @:refs/for/$1\"
[push]
default = current
The line will look like this if there are any new changes:
$3
There are two main files of alias:
- alias/general.sh
- alias/dev.sh
Here are some examples:
alias ip="dig +short myip.opendns.com @resolver1.opendns.com"
# Show/hide hidden files in Finder
alias show-hidden="defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder"
alias hide-hidden="defaults write com.apple.finder AppleShowAllFiles -bool false && killall Finder"
alias .....='cd ../../../..'
alias desktop='cd ~/Desktop && open .'
# application related
alias gu='gulp'
alias x='gitx'
alias g=git
# node related
alias ni='node-inspector --preload=false &'
alias nd='node --debug'
alias cleanup='rm -rf node_modules'
Entry point: install.sh
Installation is base on the following orders:
1. OS Update
2. Homebrew
3. Development tools
4. Atom
# give root permission to install system packages
sudo -v
# Update OS
sudo softwareupdate -iva
It will install homebrew with brew cask.
You can just append the following to Brewfile, that's it.
brew 'nvm'
cask 'google-chrome'
Atom installs packages via its own cli called apm.
You can add desired packages easily:
# jumper
apm install project-switcher # (cmd + ;)
apm install line-jumper # (alt + up/down)
# show color
apm install pigments
# linting
apm install linter
apm install linter-eslint
# snippets
apm install es6-javascript
apm install react
# git related
apm install git-blame # (ctrl + b)
apm install git-history # (ctrl + alt + h)
apm install merge-conflicts # (alt + m + d)
apm install show-origin # (ctrl + alt + o)
apm install line-diff-details
apm install branch-status
It will install the following libs to kickstart development process:
xcode-select --install
if [ -z "$NPM_VERSION" ]; then
nvm install $NPM_VERSION
fi
npm install -g gulp
npm install -g babel-cli
heroku update
# to launch start mongodb at login
ln -sfv /usr/local/opt/mongodb/*.plist ~/Library/LaunchAgents
# load mongodb now:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist
Enjoy!