Category Archives: Development Setup

Setting up VS Code with Rails, Elixir, JavaScript

Let’s make sure we can start VS Code from the terminal:

Command + Shift + P
Type Shell
Select Command : Install code in PATH

Extensions

Rails

JavaScript

Git

Elixir

Other stuff

Personal Settings

"editor.formatOnSave": true,
  "editor.fontLigatures": true,
  "editor.fontFamily": "FiraCode-Retina",
  "editor.fontSize": 18,
  "editor.renderIndentGuides": true,
  "files.exclude": {
    "**/.git": true,
    "**/node_modules": true,
    "**/bower_components": true,
    "**/tmp": true,
    "tmp/**": true,
    "**/vendor": true,
    "vendor": true,
    ".bundle": true,
    ".github": true,
    ".sass-cache": true,
    "features/reports": true
  },

  "editor.tabSize": 2,
  "prettier.singleQuote": true,
  "workbench.colorTheme": "Monokai",
  "window.zoomLevel": 0,
  "editor.renderWhitespace": "boundary",
  "editor.renderControlCharacters": true,

  "ruby.lint": {
    "rubocop": true,
    "ruby": true,
    "fasterer": true,
    "reek": false,
    "ruby-lint": false
  },
  "editor.quickSuggestions": {
    "strings": true
  },

  "cucumberautocomplete.steps": [
    "features/step_definitions/*.rb",
    "features/step_definitions/**/*.rb",
    "features/step_definitions/**/**/*.rb"
  ],
  "cucumberautocomplete.syncfeatures": "features/*feature"

Some common exclusions for .solagraph.yml (can place it in the root of your project)

---
include:
- "app/**/*.rb"
- "lib/**/*.rb"
- "engines/engine_name/app/**/*.rb"
- "engines/engine_name/lib/**/*.rb"
- "config/**/*.rb"
exclude:
- app/javascript/**/*
- node_modules/**/**
- spec/**/*
- test/**/*
- vendor/**/*
- ".bundle/**/*"
- .bundle/**/*
- uploads/**/*
- .bundle/**/*
- .git/**/*
- engines/engine_name/.bundle/**/*
- engines/engine_name/vendor/**/*
- coverage/**/*
require: []
domains: []
reporters:
- rubocop
- require_not_found
plugins: []
require_paths: []
max_files: 5000
plugins:
- runtime

Setting Up My Mac Dev Environment

Set up a package manager: Homebrew

Istall iterm2

ZSH

Replace bash with zsh (it offers some nice plugins and themes).

brew install zsh zsh-completions

Install oh-my-zsh – “A delightful community-driven (with 1,000+ contributors) framework for managing your zsh configuration.”

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

To update oh-my-zsh, run upgrade_oh_my_zsh in zsh shell.

Pick your set of plugins (edit .zshrc file):
plugins=(git brew gem ruby rvm rails yarn npm)

Pick a theme (.zshrc):

ZSH_THEME="af-magic"
If you're on OSX Sierra, then you need another step:
create ~/.ssh/config with this content:
Host *
  UseKeychain yes
  AddKeysToAgent yes
  IdentityFile ~/.ssh/id_rsa

Generate github SSH Keys – https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/

Add generated ssh key to your keychain, so you don’t have to reenter your ssh passphrase:

 ssh-add -K ~/.ssh/id_rsa 

Rails/Ruby/RVM/rbenv

If using rvm with zsh, add this to your .zshrc:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"

If you use rbenv, you may need to add this to your .zshrc:

export PATH="$HOME/.rbenv/shims :$PATH"
eval "$(rbenv init -)"

Exercism

For exercism zsh completions, add

if [ -f ~/.config/exercism/exercism_completion.zsh ]; then
. ~/.config/exercism/exercism_completion.zsh
fi

And run

$ mkdir -p ~/.config/exercism/
$ curl http://cli.exercism.io/exercism_completion.zsh > ~/.config/exercism/exercism_completion.zsh

git standup

git-standup

brew install git-standup

fzf is a general-purpose command-line fuzzy finder

https://github.com/junegunn/fzf#key-bindings-for-command-line

brew install fzf
# Install shell extensions
/usr/local/opt/fzf/install

autojump – a faster way to navigate your filesystem

https://github.com/wting/autojump

brew install autojump

# add autoload to .zshrc
[[ -s $(brew --prefix)/etc/profile.d/autojump.sh ]] && . $(brew --prefix)/etc/profile.d/autojump.sh

fkill – Fabulously kill processes

https://github.com/sindresorhus/fkill-cli
https://github.com/SamVerschueren/alfred-fkill

npm install --global fkill-cli
npm install --global alfred-fkill

Mac apps

Git alias (add to .gitconfig)

Show recent branches:
[alias]
recent = “for-each-ref –sort=-committerdate –count=10 –format=’%(refname:short)’ refs/heads/”

Python

Install Anaconda – https://www.anaconda.com/distribution/#download-section

Update your .bashrc or .zshrc with

export PATH="$HOME/anaconda3/bin:$PATH"