Skip to content

Instantly share code, notes, and snippets.

@ltfschoen
Last active January 15, 2024 10:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ltfschoen/12f04c6c20b2b722d20596fcb58e3cee to your computer and use it in GitHub Desktop.
Save ltfschoen/12f04c6c20b2b722d20596fcb58e3cee to your computer and use it in GitHub Desktop.
setup mac
* Setup
* Create an use a non-root Standard user account and sign-in with it
* https://apple.stackexchange.com/questions/192365/is-it-ok-to-use-the-root-user-as-a-normal-user
* Change sudo timeout https://www.maketecheasier.com/edit-sudoers-file-linux/
* Add user to sudoers file. Login as root. Type `sudo visudo` and add to bottom of file `<USERNAME> ALL=(ALL) ALL`
* Enable mac Firewall
* Remove icons not wanted by uncheck 'Keep in Dock'
* Directory structure: code/src/<github-repo>/<username>
* Install Riot chat: https://riot.im/desktop.html
* Add to ~/.gitexcludes `.DS_Store`
* Add to ~/.gitconfig
* IMPORTANT - Apple M1 (Silicon) - install brew and programs like nvm this way https://stackoverflow.com/a/64997047/3208553
```
You should change the ownership of these directories to your user.
sudo chown -R $(whoami) /usr/local/Homebrew /usr/local/etc/bash_completion.d /usr/local/lib/pkgconfig /usr/local/share/aclocal /usr/local/share/doc /usr/local/share/info /usr/local/share/locale /usr/local/share/man /usr/local/share/man/man1 /usr/local/share/man/man3 /usr/local/share/man/man5 /usr/local/share/man/man7 /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var/homebrew/linked /usr/local/var/homebrew/locks
And make sure that your user has write permission.
chmod u+w /usr/local/Homebrew /usr/local/etc/bash_completion.d /usr/local/lib/pkgconfig /usr/local/share/aclocal /usr/local/share/doc /usr/local/share/info /usr/local/share/locale /usr/local/share/man /usr/local/share/man/man1 /usr/local/share/man/man3 /usr/local/share/man/man5 /usr/local/share/man/man7 /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var/homebrew/linked /usr/local/var/homebrew/locks
```
* contents of non-sudo user's ~/.profile
```
source "$HOME/.cargo/env"
eval "$(/usr/local/bin/brew shellenv)"
export NVM_DIR="$HOME/.nvm"
[ -s "/usr/local/opt/nvm/nvm.sh" ] && . "/usr/local/opt/nvm/nvm.sh" # This loads nvm
[ -s "/usr/local/opt/nvm/etc/bash_completion.d/nvm" ] && . "/usr/local/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion
```
```
mkdir -p ~/code/src
```
```
[color]
branch = auto
diff = auto
status = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
[color "status"]
added = yellow
changed = green
untracked = cyan
```
* Create Github SSH Keys. Add to https://github.com/account/ssh
* https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/
```
ssh-keygen -t rsa -b 4096 -C "Luke Schoen <ltfschoen@gmail.com>"
pbcopy < /Users/ls/.ssh/id_rsa.pub
```
* Setup Shell Script including Dotfile
```
echo "Installing compiler Xcode Command Line Tools"
xcode-select --install
# Check for Homebrew and install if necessary
if test ! $(which brew); then
echo "Installing Homebrew..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
export PATH="/usr/local/bin:/usr/local/sbin:~/bin:$PATH"
(echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/luke/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
brew doctor
brew update
fi
echo "Installing Git..."
brew install git;
git config --global user.name "Luke Schoen";
git config --global user.email "ltfschoen@gmail.com";
git config --global color.ui auto;
echo "Installing Utils..."
# Install GNU core utilities (those that come with OS X are outdated)
brew install coreutils;
brew install gnu-sed;
brew install gnu-tar;
brew install gnu-indent;
brew install gnu-which;
brew install grep;
# https://github.com/Homebrew/brew/issues/5731
export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH";
# Install GNU `find`, `locate`, `updatedb`, and `xargs`, g-prefixed
brew install findutils;
echo "Installing with Homebrew..."
brew install bash; # Bash 4
# Install Docker for Mac
brew install bash-completion;
brew install --cask docker;
echo '[[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]] && . "/usr/local/etc/profile.d/bash_completion.sh"' >> ~/.bash_profile
source ~/.bash_profile;
echo "Installing with Homebrew Cask..."
brew tap phinze/cask;
brew install brew-cask;
brew install brew-cask-completion;
# brew install caskroom/cask/brew-cask;
# brew install --cask or brew cask install
brew install git
brew install --cask visual-studio-code google-chrome discord gitter slack telegram-desktop zoomus
# to verify gpg signatures
brew install --cask gpg-suite
echo "Installing Languages..."
curl https://sh.rustup.rs -sSf | sh;
rustc --verson;
# https://docs.python-guide.org/dev/virtualenvs/
brew install python3 pipenv pyenv;
python3 --version;
pip3 --version;
echo "Installing with Homebrew..."
brew install node@15; # /usr/local/opt/node@8/bin
# Install TypeScript
npm install -g typescript;
npm install -g tslint;
# Install Kubernetes
brew install kubectl
PACKAGES=(
bash
tree
wget
mackup
yarn
)
brew install ${PACKAGES[@]}
# Casks
CASKS=(
# General
suspicious-package
# Productivity
alfred
dash
# Design
adobe-creative-cloud
# UI config
bartender # Mac menu bar
# Browsers
firefox
google-chrome
opera
# Storage
google-drive-file-stream
# Developer tools
clion
intellij-idea
diffmerge # Visually compare and merge files
sequel-pro
sourcetree # Git GUI
textexpander # Boilerplate templates
visual-studio-code
# Team sharing
licecap # Screen record and save as animated GIF
# Communication
discord
gitter
# riot
skype
slack
telegram-desktop
zoomus
# DB
# mongodb
# postgres
# sequel-pro
# Entertainment
spotify
steam
vox
vlc
)
# Install apps to /Applications
# Default is: /Users/$user/Applications
echo "Installing apps with Homebrew Cask..."
brew install --cask --appdir="/Applications" ${CASKS[@]}
brew cask alfred link
echo "Installing fonts..."
brew tap caskroom/fonts
FONTS=(
font-roboto
font-clear-sans
)
brew cask install ${FONTS[@]}
echo "Cleaning up Homebrew and Homebrew Cask"
brew cask cleanup
brew cleanup
echo 'export PATH="/usr/local/opt/icu4c/bin:$PATH"' >> ~/.bash_profile
echo 'export PATH="/usr/local/opt/icu4c/sbin:$PATH"' >> ~/.bash_profile
echo 'export PATH="/usr/local/opt/sqlite/bin:$PATH"' >> ~/.bash_profile
echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile
source ~/.bash_profile;
echo "Configuring Mac settings..."
#"Show IP address, hostname, OS version when clicking the clock in the login window"
sudo defaults write /Library/Preferences/com.apple.loginwindow AdminHostInfo HostName
#"Disabling automatic termination of inactive apps"
defaults write NSGlobalDomain NSDisableAutomaticTermination -bool true
#"Allow text selection in Quick Look"
defaults write com.apple.finder QLEnableTextSelection -bool TRUE
#"Disabling OS X Gate Keeper allowing installation of non-App Store apps"
sudo spctl --master-disable
sudo defaults write /var/db/SystemPolicy-prefs.plist enabled -string no
defaults write com.apple.LaunchServices LSQuarantine -bool false
#"File - Expanding the Save panel in apps by default so not have to always expand manually"
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
#"File - Saving to disk (not to iCloud) by default"
defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false
#"File - Disabling the warning when changing a file extension"
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false
#"File - Avoiding the creation of .DS_Store files on network volumes"
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
#"Finder - Showing all filename extensions in Finder by default"
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
#"Finder - Show hidden files by default"
defaults write com.apple.finder AppleShowAllFiles -bool true
#"Finder - Show status bar"
defaults write com.apple.finder ShowStatusBar -bool true
#"Finder - Use column view in all Finder windows by default"
# Four-letter codes for the other view modes: icnv, clmv, Flwv"
defaults write com.apple.finder FXPreferredViewStyle Clmv
#"Finder - Disable the warning before emptying the Trash"
defaults write com.apple.finder WarnOnEmptyTrash -bool false
#"Finder - Showing icons for hard drives, servers, and removable media on the desktop"
defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool true
#"Interface"
defaults write NSUserDefaults AppleActionOnDoubleClick -string "Maximize"
#"Interface"
defaults write -g AppleShowScrollBars -string Always
#"Interface"
defaults write GlobalPreferences NSCloseAlwaysConfirmsChanges -bool true
#"Interface"
defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool true
#"Interface - Disabling system-wide resume of opened file"
defaults write NSGlobalDomain NSQuitAlwaysKeepsWindows -bool false
#"Interface - Set highlight colour to green"
defaults write NSGlobalDomain AppleHighlightColor -string "0.764700 0.976500 0.568600"
#"Interface - Set sidebar icon size to medium"
defaults write NSGlobalDomain NSTableViewDefaultSizeMod -int 2
#"Interface - Set table view default size"
defaults write NSGlobalDomain NSTableViewDefaultSizeMode -int 2
#"Keyboard - Enabling full keyboard access for all controls (e.g. enable Tab in modal dialogs)"
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3
#"Keyboard - Disabling press-and-hold for keys in favor of a key repeat"
defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
#"Keyboard - Set very fast keyboard repeat rate"
defaults write NSGlobalDomain KeyRepeat -int 1
#"Keyboard - Set shorter delay until key repeat (default 68)"
defaults write NSGlobalDomain InitialKeyRepeat -int 12
#"Keyboard - Automatically illuminate built-in MacBook keyboard in low light"
defaults write com.apple.BezelServices kDim -bool true
#"Keyboard - Turn off keyboard illumination when computer is not used for 5 minutes"
defaults write com.apple.BezelServices kDimTime -int 300
#"Localisation"
defaults write NSGlobalDomain AppleLocale -string "en_AU@currency=AUD"
#"Localisation"
defaults write NSGlobalDomain AppleMeasurementUnits -string "Centimeters"
#"Localisation"
defaults write NSGlobalDomain AppleMetricUnits -bool true
#"Localisation"
defaults write NSGlobalDomain AppleTemperatureUnit -string "Celsius"
#"Print"
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint2 -bool true
#"Security - Require password as soon as screensaver or sleep mode starts"
defaults write com.apple.screensaver askForPassword -int 1
defaults write com.apple.screensaver askForPasswordDelay -int 0
#"Sound - Increase sound quality for Bluetooth headphones/headsets"
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" -int 40
#"Automatically quit printer app once the print jobs complete"
defaults write com.apple.print.PrintingPrefs "Quit When Finished" -bool true
#"Check for software updates daily, not just once per week"
defaults write com.apple.SoftwareUpdate ScheduleFrequency -int 1
#"Text - Disable smart quotes and smart dashes as they are annoying when typing code"
defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false
defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false
defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false
defaults write NSGlobalDomain NSAutomaticCapitalizationEnabled -bool false
defaults write NSGlobalDomain NSAutomaticPeriodSubstitutionEnabled -bool false
defaults write NSGlobalDomain NSAutomaticTextCompletionEnabled -bool false
defaults write NSGlobalDomain WebAutomaticSpellingCorrectionEnabled -bool false
defaults write NSGlobalDomain NSTextShowsControlCharacters -bool true
defaults write NSGlobalDomain NSSpellCheckerAutomaticallyIdentifiesLanguages -bool true
#"Trackpad"
defaults write NSGlobalDomain com.apple.trackpad.scaling -float 1.5
#"Setting trackpad & mouse speed to a reasonable number"
defaults write -g com.apple.trackpad.scaling 2
defaults write -g com.apple.mouse.scaling 2.5
#"Enabling subpixel font rendering on non-Apple LCDs"
defaults write NSGlobalDomain AppleFontSmoothing -int 2
#"Enabling snap-to-grid for icons on the desktop and in other icon views"
/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
#"Setting the icon size of Dock items to 36 pixels for optimal size/screen-realestate"
defaults write com.apple.dock tilesize -int 36
#"Speeding up Mission Control animations and grouping windows by application"
defaults write com.apple.dock expose-animation-duration -float 0.1
defaults write com.apple.dock "expose-group-by-app" -bool true
#"Setting Dock to auto-hide and removing the auto-hiding delay"
defaults write com.apple.dock autohide -bool true
defaults write com.apple.dock autohide-delay -float 0
defaults write com.apple.dock autohide-time-modifier -float 0
#"Setting email addresses to copy as 'foo@example.com' instead of 'Foo Bar <foo@example.com>' in Mail.app"
defaults write com.apple.mail AddressesIncludeNameOnPasteboard -bool false
#"Enabling UTF-8 ONLY in Terminal.app and setting the Pro theme by default"
defaults write com.apple.terminal StringEncodings -array 4
defaults write com.apple.Terminal "Default Window Settings" -string "Pro"
defaults write com.apple.Terminal "Startup Window Settings" -string "Pro"
#"Preventing Time Machine from prompting to use new hard drives as backup volume"
defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool true
#"Disable the sudden motion sensor as its not useful for SSDs"
sudo pmset -a sms 0
#"Speeding up wake from sleep to 24 hours from an hour"
# http://www.cultofmac.com/221392/quick-hack-speeds-up-retina-macbooks-wake-from-sleep-os-x-tips/
sudo pmset -a standbydelay 86400
#"Disable annoying backswipe in Chrome"
defaults write com.google.Chrome AppleEnableSwipeNavigateWithScrolls -bool false
#"Setting screenshots location to ~/Desktop"
defaults write com.apple.screencapture location -string "$HOME/Desktop"
#"Setting screenshot format to PNG"
defaults write com.apple.screencapture type -string "png"
#"Hiding Safari's bookmarks bar by default"
defaults write com.apple.Safari ShowFavoritesBar -bool false
#"Hiding Safari's sidebar in Top Sites"
defaults write com.apple.Safari ShowSidebarInTopSites -bool false
#"Disabling Safari's thumbnail cache for History and Top Sites"
defaults write com.apple.Safari DebugSnapshotsUpdatePolicy -int 2
#"Enabling Safari's debug menu"
defaults write com.apple.Safari IncludeInternalDebugMenu -bool true
#"Making Safari's search banners default to Contains instead of Starts With"
defaults write com.apple.Safari FindOnPageMatchesWordStartsOnly -bool false
#"Removing useless icons from Safari's bookmarks bar"
defaults write com.apple.Safari ProxiesInBookmarksBar "()"
#"Allow hitting the Backspace key to go to the previous page in history"
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2BackspaceKeyNavigationEnabled -bool true
#"Enabling the Develop menu and the Web Inspector in Safari"
defaults write com.apple.Safari IncludeDevelopMenu -bool true
defaults write com.apple.Safari WebKitDeveloperExtrasEnabledPreferenceKey -bool true
defaults write com.apple.Safari "com.apple.Safari.ContentPageGroupIdentifier.WebKit2DeveloperExtrasEnabled" -bool true
#"Web Views"
defaults write -g WebKitDeveloperExtras -bool true
#"Adding a context menu item for showing the Web Inspector in web views"
defaults write NSGlobalDomain WebKitDeveloperExtras -bool true
#"Disable 'natural' (Lion-style) scrolling"
defaults write NSGlobalDomain com.apple.swipescrolldirection -bool false
#"Don't automatically rearrange Spaces based on most recent use"
defaults write com.apple.dock mru-spaces -bool false
#"Enable SSH"
#sudo launchctl load -w /System/Library/LaunchDaemons/ssh.plist
#"Enable VNC"
#sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -on -clientopts -setvnclegacy -vnclegacy yes -clientopts -setvncpw -vncpw PutYourOwnPasswordHere -restart -agent -privs -all
#"Silence boot sound"
sudo nvram SystemAudioVolume=" "
#"Allow files downloaded from anywhere to be opened"
sudo spctl —-master-disable
# Hot corners
# Possible values:
# 0: no-op
# 2: Mission Control
# 3: Show application windows
# 4: Desktop
# 5: Start screen saver
# 6: Disable screen saver
# 7: Dashboard
# 10: Put display to sleep
# 11: Launchpad
# 12: Notification Center
# Top left screen corner
# defaults write com.apple.dock wvous-tl-corner -int 2
# defaults write com.apple.dock wvous-tl-modifier -int 0
# Top right screen corner
# defaults write com.apple.dock wvous-tr-corner -int 5
# defaults write com.apple.dock wvous-tr-modifier -int 0
# Bottom left screen corner
defaults write com.apple.dock wvous-bl-corner -int 4
defaults write com.apple.dock wvous-bl-modifier -int 0
# Bottom right screen corner
defaults write com.apple.dock wvous-bl-corner -int 10
defaults write com.apple.dock wvous-bl-modifier -int 0
killall Finder
killall Dock
echo "Done! Restart computer to see changes"
```
* Create and modify ~/.bash_profile
```
touch ~/.bash_profile
# Coloured Terminal Prompt with Git info
export PS1='\[\033[0;32m\]\[\033[0m\033[0;32m\]\u\[\033[0;36m\] @ \w\[\033[0;32m\] - [$(git branch 2>/dev/null | grep "^*" | colrm 1 2)\[\033[0;32m\]]\[\033[0m\033[0;32m\] \$\[\033[0m\033[0;32m\]\[\033[0m\] '
export EDITOR="code -w"
cd ~/code/src
```
* If using ~/.zsh
```
export HOMEBREW_CASK_OPTS="--appdir=~/Applications"
```
* On macOS Catalina, zsh is default terminal instead of bash, so don't use the above coloured terminal prompt. Instead do th following
* References:
* https://www.freecodecamp.org/news/jazz-up-your-zsh-terminal-in-seven-steps-a-visual-guide-e81a8fd59a38/
* https://medium.com/ayuth/iterm2-zsh-oh-my-zsh-the-most-power-full-of-terminal-on-macos-bdb2823fb04c
* https://catalins.tech/improve-mac-terminal/
* Theme for iTerm2 - Meslo LG L DZ for Powerline - font
* Shows how to use same theme with git prompt in VSCode
* Search internet from terminal with `web_search google ...`
```
brew install --cask iterm2
brew install zsh
chsh -s /usr/local/bin/zsh
echo $0
which zsh
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
git clone https://github.com/powerline/fonts.git
cd fonts
./install.sh
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-autosuggestions.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
```
* Modify the following in ~/.zshrc to add an "Oh My ZSH" theme from https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
```
ZSH_THEME="agnoster"
plugins=(
git
zsh-syntax-highlighting
zsh-autosuggestions
web-search
)
```
* Run the following in non-admin users
```
chmod -R 755 /usr/local/share/zsh
```
* Restart terminal
```
source ~/.zshrc
```
* Add Sublime shortcut
```
ln -s /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl
```
* Setup VS Code
* Command Panel -
* CMD + SHIFT + P
* "Install Extension"
* Show integrated terminal - CTRL + <
* Show TSLint problems - SHIFT + CMD + M
* Editing
* https://code.visualstudio.com/docs/editor/codebasics
* Snippets
* Code > Preferences > User Snippets
* Typescript React
* https://code.visualstudio.com/docs/editor/userdefinedsnippets
* Workspaces
* https://code.visualstudio.com/docs/editor/multi-root-workspaces
* Open saved workspace
```
code parity.code-workspace
```
* Add to workspace
```
cd ~/code/src;
code --add paritytech/ polkadot-js/
```
* Install extensions to ~/.vscode/extensions
```
code --install-extension dbaeumer.vscode-eslint
code --install-extension eamodio.gitlens
code --install-extension msjsdiag.debugger-for-chrome
code --install-extension robertohuertasm.vscode-icons
code --install-extension infeng.vscode-react-typescript
code --install-extension Orta.vscode-jest
code --install-extension PeterJausovec.vscode-docker
code --install-extension rust-lang.rust-analyzer
code --install-extension editorconfig.editorconfig
code --install-extension tabnine.tabnine-vscode
code --install-extension zainchen.json
code --install-extension ccimage.jsonviewer
code --install-extension shd101wyy.markdown-preview-enhanced
code --install-extension ms-python.python
code --install-extension juanblanco.solidity
code --install-extension enfipy.plugin-polkadot
code --install-extension be5invis.toml
code --install-extension ms-azuretools.vscode-docker
code --install-extension dart-code.dart-code
code --install-extension dart-code.flutter
code --install-extension blockstack.clarity
code --install-extension lgalabru.clarity-lsp
code --install-extension 2gua.rainbow-brackets
code --install-extension golang.go
code --install-extension windmilleng.vscode-go-autotest
code --install-extension zxh404.vscode-proto3
code --install-extension msyrus.go-doc
code --install-extension premparihar.gotestexplorer
code --install-extension lourenci.go-to-spec
code --install-extension haozibi.goplay
code --install-extension Dart-Code.flutter
code --list-extensions
```
* Find files
* `CMD + SPACE`
* Code > Preferences > Settings
* User Settings
```
{
"terminal.integrated.fontFamily" : "Meslo LG L DZ For Powerline",
"gitlens.advanced.messages": {
"suppressShowKeyBindingsNotice": true
},
"workbench.iconTheme": "vscode-icons",
"files.exclude": {
"**/.DS_Store": true,
},
"editor.tabSize": 2
}
```
* http://blog.wolksoftware.com/setting-up-your-typescript-vs-code-development-environment
* TODO
* Install [React Dev Tools](https://chrome.google.com/webstore/category/extensions?hl=en) for Chrome browser
* Debugger for Chrome VS Code using "Launch" template
* https://code.visualstudio.com/blogs/2016/02/23/introducing-chrome-debugger-for-vs-code
* https://github.com/Microsoft/vscode-chrome-debug
```
{
"version": "0.1.0",
"configurations": [
{
"name": "Launch localhost",
"type": "chrome",
"request": "launch",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}"
},
{
"name": "Launch index.html",
"type": "chrome",
"request": "launch",
"file": "${workspaceFolder}/packages/apps/public/index.html"
},
]
}
```
* Check that all programs installed
* Install Sublime Text 2 https://www.sublimetext.com/2
* Change screensaver so works using Hot Corners. Add password immediately upon screensaver in Security & Privacy
* Save Mac Defaults in textfile before changing them
`touch DefaultsGlobal.txt
defaults read NSGlobalDomain > DefaultsGlobal.txt`
* Setup dotfiles
* https://gist.github.com/ltfschoen/a9e533a4cc5362e78c485158e2911e28
* Enable File Vault NOW to prevent physical access to computer with bootable drive
* Backup on Time Machine
* Setup Node.js, Yarn
* Switch versions
```
brew switch node <version>
```
* Setup Mackup (backup, sync and restore app config settings to Google Drive or Dropbox)
```
mackup backup;
mackup restore;
```
* Setup environment variables (so automatically invoked by VCS)
```
export EDITOR="code -w"
```
* Setup VS Code Packages
* Languages: Python, Ruby, JavaScript, HTML, CSS, YAML, JSON, Markdown
* Transpilers: Typescript
* Linters: ESLint, TSLint
* Debugger: Debugger for Chrome to debug JavaScript in web browser
* Git: Git Lens to enhance Git support in UI
* Docker: The Docker extension
* Optional
* QWERTZ keyboard instead of QWERTY
* Commonly used non-letter for copy/paste: !@#$%^&*_-+=()[]{};:'"`~,.<>\|/?
* Buy replacement keyboard stickers online
* Install mac software updates 'softwareupdates -l'
* https://www.cyberciti.biz/faq/apple-mac-os-x-update-softwareupdate-bash-shell-command/
* Databases with Docker
* Ongoing
* Find Homebrew package, or Homebrew Cask package
```
brew search <packagename>,
brew cask search <packagename>
```
* Update PATH
```
echo "export PATH=$PATH:/path/to/dir" >> ~/.bash_profile;
source ~/.bash_profile;
```
* References
* https://www.stuartellis.name/articles/mac-setup/
* https://medium.com/@chrisrickard/automate-the-setup-of-your-development-environment-157cd4ed5ca1
* https://gist.github.com/ltfschoen/a9e533a4cc5362e78c485158e2911e28
* https://gist.github.com/codeinthehole/26b37efa67041e1307db
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment