├── rspec ├── config ├── irbrc ├── README.md ├── zprofile ├── keybindings.json ├── git_setup.sh ├── aliases ├── LICENSE ├── gitconfig ├── install.sh ├── zshrc └── settings.json /rspec: -------------------------------------------------------------------------------- 1 | --color --format documentation 2 | -------------------------------------------------------------------------------- /config: -------------------------------------------------------------------------------- 1 | Host * 2 | UseKeychain yes 3 | AddKeysToAgent yes 4 | IdentityFile ~/.ssh/id_ed25519 5 | -------------------------------------------------------------------------------- /irbrc: -------------------------------------------------------------------------------- 1 | begin 2 | require 'rubygems' 3 | require 'pry' 4 | rescue LoadError 5 | end 6 | 7 | if defined?(Pry) 8 | Pry.start 9 | exit 10 | end 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | This repository is used by [Le Wagon](https://www.lewagon.com) students. 2 | 3 | ## Toolset 4 | 5 | - [oh-my-zsh](http://ohmyz.sh/) 6 | - [Visual Studio Code](https://code.visualstudio.com/) 7 | - [git](https://git-scm.com/) 8 | -------------------------------------------------------------------------------- /zprofile: -------------------------------------------------------------------------------- 1 | # Setup the PATH for pyenv binaries and shims 2 | export PYENV_ROOT="$HOME/.pyenv" 3 | export PATH="$PYENV_ROOT/bin:$PATH" 4 | eval "$(/opt/homebrew/bin/brew shellenv 2> /dev/null)" 5 | type -a pyenv > /dev/null && eval "$(pyenv init --path)" 6 | -------------------------------------------------------------------------------- /keybindings.json: -------------------------------------------------------------------------------- 1 | // Place your key bindings in this file to override the defaults 2 | [ 3 | { 4 | "key": "ctrl+shift+v", 5 | "command": "pasteAndIndent.action", 6 | "when": "editorTextFocus && !editorReadonly" 7 | }, 8 | { 9 | "key": "cmd+shift+v", 10 | "command": "pasteAndIndent.action", 11 | "when": "editorTextFocus && !editorReadonly" 12 | } 13 | ] 14 | -------------------------------------------------------------------------------- /git_setup.sh: -------------------------------------------------------------------------------- 1 | echo "Type in your first and last name (no accent or special characters - e.g. 'ç'): " 2 | read full_name 3 | 4 | echo "Type in your email address (the one used for your GitHub account): " 5 | read email 6 | 7 | git config --global user.email "$email" 8 | git config --global user.name "$full_name" 9 | 10 | git add . 11 | git commit --message "My identity for @lewagon in the gitconfig" 12 | git push origin master 13 | 14 | git remote add upstream git@github.com:lewagon/dotfiles.git 15 | 16 | echo "👌 Awesome, all set." 17 | -------------------------------------------------------------------------------- /aliases: -------------------------------------------------------------------------------- 1 | # Get External IP / Internet Speed 2 | alias myip="curl https://ipinfo.io/json" # or /ip for plain-text ip 3 | alias speedtest="curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python -" 4 | 5 | # Quickly serve the current directory as HTTP 6 | alias serve='ruby -run -e httpd . -p 8000' # Or python -m SimpleHTTPServer :) 7 | 8 | # NOTE: On Q3 2021, Le Wagon decided to change the Web Dev curriculum default text editor 9 | alias stt="echo 'Launching VS Code instead of Sublime Text... (cf ~/.aliases)' && code ." 10 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 La Loco SAS, head of Le Wagon Group 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /gitconfig: -------------------------------------------------------------------------------- 1 | [color] 2 | branch = auto 3 | diff = auto 4 | interactive = auto 5 | status = auto 6 | ui = auto 7 | 8 | [color "branch"] 9 | current = green 10 | remote = yellow 11 | 12 | [core] 13 | pager = less -FRSX 14 | editor = code --wait 15 | 16 | [alias] 17 | co = checkout 18 | st = status -sb 19 | br = branch 20 | ci = commit 21 | fo = fetch origin 22 | d = !git --no-pager diff 23 | dt = difftool 24 | stat = !git --no-pager diff --stat 25 | 26 | # Set remotes/origin/HEAD -> defaultBranch (copied from https://stackoverflow.com/a/67672350/14870317) 27 | remoteSetHead = remote set-head origin --auto 28 | 29 | # Get default branch name (copied from https://stackoverflow.com/a/67672350/14870317) 30 | defaultBranch = !git symbolic-ref refs/remotes/origin/HEAD | cut -d'/' -f4 31 | 32 | # Clean merged branches (adapted from https://stackoverflow.com/a/6127884/14870317) 33 | sweep = !git branch --merged $(git defaultBranch) | grep -E -v " $(git defaultBranch)$" | xargs -r git branch -d && git remote prune origin 34 | 35 | # http://www.jukie.net/bart/blog/pimping-out-git-log 36 | lg = log --graph --all --pretty=format:'%Cred%h%Creset - %s %Cgreen(%cr) %C(bold blue)%an%Creset %C(yellow)%d%Creset' 37 | 38 | # Serve local repo. http://coderwall.com/p/eybtga 39 | # Then other can access via `git clone git://#{YOUR_IP_ADDRESS}/ 40 | serve = !git daemon --reuseaddr --verbose --base-path=. --export-all ./.git 41 | 42 | # Checkout to defaultBranch 43 | m = !git checkout $(git defaultBranch) 44 | 45 | # Removes a file from the index 46 | unstage = reset HEAD -- 47 | 48 | [help] 49 | autocorrect = 1 50 | 51 | [push] 52 | default = simple 53 | 54 | [branch "master"] 55 | mergeoptions = --no-edit 56 | 57 | [pull] 58 | rebase = false 59 | 60 | [init] 61 | defaultBranch = master 62 | -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/zsh 2 | 3 | # Define a function which rename a `target` file to `target.backup` if the file 4 | # exists and if it's a 'real' file, ie not a symlink 5 | backup() { 6 | target=$1 7 | if [ -e "$target" ]; then 8 | if [ ! -L "$target" ]; then 9 | mv "$target" "$target.backup" 10 | echo "-----> Moved your old $target config file to $target.backup" 11 | fi 12 | fi 13 | } 14 | 15 | symlink() { 16 | file=$1 17 | link=$2 18 | if [ ! -e "$link" ]; then 19 | echo "-----> Symlinking your new $link" 20 | ln -s $file $link 21 | fi 22 | } 23 | 24 | # For all files `$name` in the present folder except `*.sh`, `README.md`, `settings.json`, 25 | # and `config`, backup the target file located at `~/.$name` and symlink `$name` to `~/.$name` 26 | for name in aliases gitconfig irbrc rspec zprofile zshrc; do 27 | if [ ! -d "$name" ]; then 28 | target="$HOME/.$name" 29 | backup $target 30 | symlink $PWD/$name $target 31 | fi 32 | done 33 | 34 | # Install zsh-syntax-highlighting plugin 35 | CURRENT_DIR=`pwd` 36 | ZSH_PLUGINS_DIR="$HOME/.oh-my-zsh/custom/plugins" 37 | mkdir -p "$ZSH_PLUGINS_DIR" && cd "$ZSH_PLUGINS_DIR" 38 | if [ ! -d "$ZSH_PLUGINS_DIR/zsh-syntax-highlighting" ]; then 39 | echo "-----> Installing zsh plugin 'zsh-syntax-highlighting'..." 40 | git clone https://github.com/zsh-users/zsh-autosuggestions 41 | git clone https://github.com/zsh-users/zsh-syntax-highlighting 42 | fi 43 | cd "$CURRENT_DIR" 44 | 45 | # Symlink VS Code settings and keybindings to the present `settings.json` and `keybindings.json` files 46 | # If it's a macOS 47 | if [[ `uname` =~ "Darwin" ]]; then 48 | CODE_PATH=~/Library/Application\ Support/Code/User 49 | # Else, it's a Linux 50 | else 51 | CODE_PATH=~/.config/Code/User 52 | # If this folder doesn't exist, it's a WSL 53 | if [ ! -e $CODE_PATH ]; then 54 | CODE_PATH=~/.vscode-server/data/Machine 55 | fi 56 | fi 57 | 58 | for name in settings.json keybindings.json; do 59 | target="$CODE_PATH/$name" 60 | backup $target 61 | symlink $PWD/$name $target 62 | done 63 | 64 | # Symlink SSH config file to the present `config` file for macOS and add SSH passphrase to the keychain 65 | if [[ `uname` =~ "Darwin" ]]; then 66 | target=~/.ssh/config 67 | backup $target 68 | symlink $PWD/config $target 69 | ssh-add --apple-use-keychain ~/.ssh/id_ed25519 70 | fi 71 | 72 | # Refresh the current terminal with the newly installed configuration 73 | exec zsh 74 | 75 | echo "👌 Carry on with git setup!" 76 | -------------------------------------------------------------------------------- /zshrc: -------------------------------------------------------------------------------- 1 | ZSH=$HOME/.oh-my-zsh 2 | 3 | # You can change the theme with another one from https://github.com/robbyrussell/oh-my-zsh/wiki/themes 4 | ZSH_THEME="robbyrussell" 5 | 6 | # Useful oh-my-zsh plugins for Le Wagon bootcamps 7 | plugins=(git gitfast last-working-dir common-aliases zsh-syntax-highlighting history-substring-search) 8 | 9 | # (macOS-only) Prevent Homebrew from reporting - https://github.com/Homebrew/brew/blob/master/docs/Analytics.md 10 | export HOMEBREW_NO_ANALYTICS=1 11 | 12 | # Disable warning about insecure completion-dependent directories 13 | ZSH_DISABLE_COMPFIX=true 14 | 15 | # Actually load Oh-My-Zsh 16 | source "${ZSH}/oh-my-zsh.sh" 17 | unalias rm # No interactive rm by default (brought by plugins/common-aliases) 18 | unalias lt # we need `lt` for https://github.com/localtunnel/localtunnel 19 | 20 | # Load rbenv if installed (to manage your Ruby versions) 21 | export PATH="${HOME}/.rbenv/bin:${PATH}" # Needed for Linux/WSL 22 | type -a rbenv > /dev/null && eval "$(rbenv init -)" 23 | 24 | # Load pyenv (to manage your Python versions) 25 | export PYENV_VIRTUALENV_DISABLE_PROMPT=1 26 | type -a pyenv > /dev/null && eval "$(pyenv init -)" && eval "$(pyenv virtualenv-init - 2> /dev/null)" && RPROMPT+='[🐍 $(pyenv version-name)]' 27 | 28 | # Load nvm (to manage your node versions) 29 | export NVM_DIR="$HOME/.nvm" 30 | [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm 31 | [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion 32 | 33 | # Call `nvm use` automatically in a directory with a `.nvmrc` file 34 | autoload -U add-zsh-hook 35 | load-nvmrc() { 36 | if nvm -v &> /dev/null; then 37 | local node_version="$(nvm version)" 38 | local nvmrc_path="$(nvm_find_nvmrc)" 39 | 40 | if [ -n "$nvmrc_path" ]; then 41 | local nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")") 42 | 43 | if [ "$nvmrc_node_version" = "N/A" ]; then 44 | nvm install 45 | elif [ "$nvmrc_node_version" != "$node_version" ]; then 46 | nvm use --silent 47 | fi 48 | elif [ "$node_version" != "$(nvm version default)" ]; then 49 | nvm use default --silent 50 | fi 51 | fi 52 | } 53 | type -a nvm > /dev/null && add-zsh-hook chpwd load-nvmrc 54 | type -a nvm > /dev/null && load-nvmrc 55 | 56 | # Rails and Ruby uses the local `bin` folder to store binstubs. 57 | # So instead of running `bin/rails` like the doc says, just run `rails` 58 | # Same for `./node_modules/.bin` and nodejs 59 | export PATH="./bin:./node_modules/.bin:${PATH}:/usr/local/sbin" 60 | 61 | # Store your own aliases in the ~/.aliases file and load the here. 62 | [[ -f "$HOME/.aliases" ]] && source "$HOME/.aliases" 63 | 64 | # Encoding stuff for the terminal 65 | export LANG=en_US.UTF-8 66 | export LC_ALL=en_US.UTF-8 67 | 68 | export BUNDLER_EDITOR=code 69 | export EDITOR=code 70 | 71 | # Set ipdb as the default Python debugger 72 | export PYTHONBREAKPOINT=ipdb.set_trace 73 | -------------------------------------------------------------------------------- /settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "[python]": { 3 | "editor.bracketPairColorization.enabled": false, 4 | "editor.guides.bracketPairs": false, 5 | "editor.tabSize": 4 6 | }, 7 | "editor.bracketPairColorization.enabled": true, 8 | "editor.detectIndentation": false, 9 | "editor.fontSize": 14, 10 | "editor.guides.bracketPairs": true, 11 | "editor.minimap.enabled": false, 12 | "editor.multiCursorModifier": "ctrlCmd", 13 | "editor.renderControlCharacters": true, 14 | "editor.rulers": [ 15 | 80, 16 | 120 17 | ], 18 | "editor.showFoldingControls": "always", 19 | "editor.snippetSuggestions": "top", 20 | "editor.tabSize": 2, 21 | "emmet.includeLanguages": { 22 | "erb": "html" 23 | }, 24 | "emmet.showSuggestionsAsSnippets": true, 25 | "emmet.triggerExpansionOnTab": true, 26 | "explorer.confirmDelete": false, 27 | "files.exclude": { 28 | "__pycache__": true, 29 | "_site": true, 30 | ".asset-cache": true, 31 | ".bundle": true, 32 | ".ipynb_checkpoints": true, 33 | ".pytest_cache": true, 34 | ".sass-cache": true, 35 | ".svn": true, 36 | "**/.DS_Store": true, 37 | "**/.egg-info": true, 38 | "**/.git": true, 39 | "build": true, 40 | "coverage": true, 41 | "dist": true, 42 | "log": true, 43 | "node_modules": true, 44 | "public/packs": true, 45 | "tmp": true 46 | }, 47 | "files.hotExit": "off", 48 | "files.insertFinalNewline": true, 49 | "files.trimFinalNewlines": true, 50 | "files.trimTrailingWhitespace": true, 51 | "files.watcherExclude": { 52 | "**/audits/**": true, 53 | "**/coverage/**": true, 54 | "**/log/**": true, 55 | "**/node_modules/**": true, 56 | "**/tmp/**": true, 57 | "**/vendor/**": true 58 | }, 59 | "git.enabled": false, 60 | "notebook.diff.ignoreMetadata": true, 61 | "notebook.lineNumbers": "on", 62 | "notebook.markup.fontSize": 13, 63 | "python.defaultInterpreterPath": "~/.pyenv/shims/python", 64 | "python.formatting.provider": "yapf", 65 | "python.languageServer": "Pylance", 66 | "python.linting.enabled": false, 67 | "python.linting.flake8Enabled": false, 68 | "python.linting.pylintEnabled": false, 69 | "python.terminal.activateEnvironment": false, 70 | "ruby.lint": { 71 | "rubocop": true 72 | }, 73 | "search.exclude": { 74 | // Inherits all glob patterns from the `files.exclude` setting. 75 | "**/.venv": true 76 | }, 77 | "telemetry.telemetryLevel": "off", 78 | "window.restoreWindows": "none", 79 | "window.newWindowDimensions": "maximized", 80 | "workbench.editor.enablePreview": true, 81 | "workbench.iconTheme": "vscode-great-icons", 82 | "workbench.settings.editor": "json", 83 | "workbench.settings.openDefaultSettings": true, 84 | "workbench.settings.useSplitJSON": true, 85 | "workbench.startupEditor": "newUntitledFile", 86 | "workbench.panel.defaultLocation": "right", 87 | } 88 | --------------------------------------------------------------------------------