{"data":{"mdx":{"body":"function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\n/* @jsxRuntime classic */\n\n/* @jsx mdx */\nvar _frontmatter = {\n  \"title\": \"MacOS\",\n  \"featuredImage\": \"./cover.jpg\"\n};\nvar layoutProps = {\n  _frontmatter: _frontmatter\n};\nvar MDXLayout = \"wrapper\";\nreturn function MDXContent(_ref) {\n  var components = _ref.components,\n      props = _objectWithoutProperties(_ref, [\"components\"]);\n\n  return mdx(MDXLayout, _extends({}, layoutProps, props, {\n    components: components,\n    mdxType: \"MDXLayout\"\n  }), mdx(\"h1\", null, \".macos\"), mdx(\"pre\", null, mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-bash\"\n  }), \"\\n#!/usr/bin/env bash\\n\\n# ~/.macos \\u2014 https://mths.be/macos\\n\\n# Close any open System Preferences panes, to prevent them from overriding\\n# settings we\\u2019re about to change\\nosascript -e 'tell application \\\"System Preferences\\\" to quit'\\n\\n# Ask for the administrator password upfront\\nsudo -v\\n\\n# Keep-alive: update existing `sudo` time stamp until `.macos` has finished\\nwhile true; do sudo -n true; sleep 60; kill -0 \\\"$$\\\" || exit; done 2>/dev/null &\\n\\n###############################################################################\\n# NVM                                                                         #\\n###############################################################################\\n\\ncurl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash\\n\\n###############################################################################\\n# Homebrew                                                                    #\\n###############################################################################\\n# install homebrew https://brew.sh\\n/usr/bin/ruby -e \\\"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)\\\"\\n\\n# brew formulae\\nbrew install node zsh git yarn heroku \\\\\\n\\n# brew cask\\nbrew cask install alfred google-chrome firefox visual-studio-code \\\\\\ndiscord spotify qmoji fork the-unarchiver iterm2 \\\\\\n\\n###############################################################################\\n# keyboard                                                                    #\\n###############################################################################\\n\\n# Enable full keyboard access for all controls\\n# (e.g. enable Tab in modal dialogs)\\ndefaults write NSGlobalDomain AppleKeyboardUIMode -int 2\\n\\n# Disable automatic capitalization as it\\u2019s annoying when typing code\\ndefaults write NSGlobalDomain NSAutomaticCapitalizationEnabled -bool false\\n\\n# Disable smart dashes as they\\u2019re annoying when typing code\\ndefaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false\\n\\n# Disable automatic period substitution as it\\u2019s annoying when typing code\\ndefaults write NSGlobalDomain NSAutomaticPeriodSubstitutionEnabled -bool false\\n\\n# Disable smart quotes as they\\u2019re annoying when typing code\\ndefaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false\\n\\n# Disable auto-correct\\ndefaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false\\n\\n# Disable press-and-hold for keys in favor of key repeat\\ndefaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false\\n\\n# Set a blazingly fast keyboard repeat rate\\ndefaults write NSGlobalDomain KeyRepeat -int 1\\ndefaults write NSGlobalDomain InitialKeyRepeat -int 12\\n\\n###############################################################################\\n# Screen                                                                      #\\n###############################################################################\\n\\n# Require password immediately after sleep or screen saver begins\\ndefaults write com.apple.screensaver askForPassword -int 1\\ndefaults write com.apple.screensaver askForPasswordDelay -int 0\\n\\n# Save screenshots to the desktop\\ndefaults write com.apple.screencapture location -string \\\"${HOME}/Desktop\\\"\\n\\n# Save screenshots in PNG format (other options: BMP, GIF, JPG, PDF, TIFF)\\ndefaults write com.apple.screencapture type -string \\\"png\\\"\\n\\n###############################################################################\\n# Finder                                                                      #\\n###############################################################################\\n\\n# Finder: allow quitting via \\u2318 + Q; doing so will also hide desktop icons\\ndefaults write com.apple.finder QuitMenuItem -bool true\\n\\n# Set Downloads as the default location for new Finder windows\\n# For other paths, use `PfLo` and `file:///full/path/here/`\\ndefaults write com.apple.finder NewWindowTarget -string \\\"PfLo\\\"\\ndefaults write com.apple.finder NewWindowTargetPath -string \\\"file://${HOME}/Downloads/\\\"\\n\\n# Show icons for hard drives, servers, and removable media on the desktop\\ndefaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool true\\ndefaults write com.apple.finder ShowHardDrivesOnDesktop -bool false\\ndefaults write com.apple.finder ShowMountedServersOnDesktop -bool false\\ndefaults write com.apple.finder ShowRemovableMediaOnDesktop -bool true\\n\\n# Finder: show hidden files by default\\ndefaults write com.apple.finder AppleShowAllFiles -bool true\\n\\n# Finder: show all filename extensions\\ndefaults write NSGlobalDomain AppleShowAllExtensions -bool true\\n\\n# Finder: show status bar\\ndefaults write com.apple.finder ShowStatusBar -bool true\\n\\n# Finder: show path bar\\ndefaults write com.apple.finder ShowPathbar -bool true\\n\\n# Display full POSIX path as Finder window title\\ndefaults write com.apple.finder _FXShowPosixPathInTitle -bool true\\n\\n# Keep folders on top when sorting by name\\ndefaults write com.apple.finder _FXSortFoldersFirst -bool true\\n\\n# When performing a search, search the current folder by default\\ndefaults write com.apple.finder FXDefaultSearchScope -string \\\"SCcf\\\"\\n\\n# Enable spring loading for directories\\ndefaults write NSGlobalDomain com.apple.springing.enabled -bool true\\n\\n# Reduce the spring loading delay for directories\\ndefaults write NSGlobalDomain com.apple.springing.delay -float 0.2\\n\\n# Avoid creating .DS_Store files on network or USB volumes\\ndefaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true\\ndefaults write com.apple.desktopservices DSDontWriteUSBStores -bool true\\n\\n# Disable disk image verification\\n#defaults write com.apple.frameworks.diskimages skip-verify -bool true\\n#defaults write com.apple.frameworks.diskimages skip-verify-locked -bool true\\n#defaults write com.apple.frameworks.diskimages skip-verify-remote -bool true\\n\\n# Automatically open a new Finder window when a volume is mounted\\ndefaults write com.apple.frameworks.diskimages auto-open-ro-root -bool true\\ndefaults write com.apple.frameworks.diskimages auto-open-rw-root -bool true\\ndefaults write com.apple.finder OpenWindowForNewRemovableDisk -bool true\\n\\n# Use column view in all Finder windows by default\\n# Four-letter codes for the other view modes: `icnv`, `clmv`, `Flwv`, `Nlsv`\\ndefaults write com.apple.finder FXPreferredViewStyle -string \\\"clmv\\\"\\n\\n# Show the ~/Library folder\\nchflags nohidden ~/Library\\n\\n# Show the /Volumes folder\\nsudo chflags nohidden /Volumes\\n\\n###############################################################################\\n# Dock, Dashboard, and hot corners                                            #\\n###############################################################################\\n\\n# Set the icon size of Dock items to 26 pixels\\ndefaults write com.apple.dock tilesize -int 26\\n\\n# Change minimize/maximize window effect\\ndefaults write com.apple.dock mineffect -string \\\"scale\\\"\\n\\n# Minimize windows into their application\\u2019s icon\\n#defaults write com.apple.dock minimize-to-application -bool true\\n\\n# Enable spring loading for all Dock items\\ndefaults write com.apple.dock enable-spring-load-actions-on-all-items -bool true\\n\\n# Show indicator lights for open applications in the Dock\\ndefaults write com.apple.dock show-process-indicators -bool tru\\n\\n# Don\\u2019t animate opening applications from the Dock\\ndefaults write com.apple.dock launchanim -bool falsee\\n\\n# Automatically hide and show the Dock\\ndefaults write com.apple.dock autohide -bool true\\n\\n# Make Dock icons of hidden applications translucent\\ndefaults write com.apple.dock showhidden -bool true\\n\\n# Auto-hide delay of the Dock\\ndefaults write com.apple.dock autohide-delay -int 0\\n\\n# Auto-hide time modifier of the Dock\\ndefaults write com.apple.dock autohide-time-modifier -float 0.25\\n\\n# Disable show recent apps\\ndefaults write com.apple.dock show-recents -int 0\\n\\n# Speed up Mission Control animations\\ndefaults write com.apple.dock expose-animation-duration -float 0.1\\n\\n# Disable the Launchpad gesture (pinch with thumb and three fingers)\\ndefaults write com.apple.dock showLaunchpadGestureEnabled -int 0\\n\\n###############################################################################\\n# Messages                                                                    #\\n###############################################################################\\n\\n# Disable automatic emoji substitution (i.e. use plain text smileys)\\ndefaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add \\\"automaticEmojiSubstitutionEnablediMessage\\\" -bool false\\n\\n# Disable smart quotes as it\\u2019s annoying for messages that contain code\\ndefaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add \\\"automaticQuoteSubstitutionEnabled\\\" -bool false\\n\\n###############################################################################\\n# Kill affected applications                                                  #\\n###############################################################################\\n\\nfor app in \\\"Activity Monitor\\\" \\\\\\n  \\\"Address Book\\\" \\\\\\n  \\\"Calendar\\\" \\\\\\n  \\\"cfprefsd\\\" \\\\\\n  \\\"Contacts\\\" \\\\\\n  \\\"Dock\\\" \\\\\\n  \\\"Finder\\\" \\\\\\n  \\\"Mail\\\" \\\\\\n  \\\"Messages\\\" \\\\\\n  \\\"Photos\\\" \\\\\\n  \\\"Safari\\\" \\\\\\n  \\\"SystemUIServer\\\" \\\\\\n  \\\"iCal\\\"; do\\n  killall \\\"${app}\\\" &> /dev/null\\ndone\\necho \\\"Done. Note that some of these changes require a logout/restart to take effect.\\\"\\n\\n\")));\n}\n;\nMDXContent.isMDXComponent = true;","frontmatter":{"title":"MacOS","featuredImage":{"childImageSharp":{"fluid":{"base64":"data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAANABQDASIAAhEBAxEB/8QAFwAAAwEAAAAAAAAAAAAAAAAAAAMEBf/EABYBAQEBAAAAAAAAAAAAAAAAAAIAAf/aAAwDAQACEAMQAAABy2JXZcQhf//EABkQAAMBAQEAAAAAAAAAAAAAAAABAgMREv/aAAgBAQABBQJZtKOqnclaVQ6PTP/EABYRAQEBAAAAAAAAAAAAAAAAAAABEf/aAAgBAwEBPwFtf//EABYRAQEBAAAAAAAAAAAAAAAAAAABEf/aAAgBAgEBPwFkf//EABgQAAIDAAAAAAAAAAAAAAAAABAhAAEx/9oACAEBAAY/AnMVhn//xAAbEAEAAgIDAAAAAAAAAAAAAAABABEhcTFhkf/aAAgBAQABPyGyDG47V+wjk1ECFSBcV5P/2gAMAwEAAgADAAAAEJjP/8QAFxEBAAMAAAAAAAAAAAAAAAAAABEhYf/aAAgBAwEBPxCLbP/EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQIBAT8QL//EABwQAQEAAwEAAwAAAAAAAAAAAAERACExQVFx0f/aAAgBAQABPxBqDYIAVlm8FPYTUI3VcYKg8fGWMKHZ74/eQQQ8LzAuN3z+Z//Z","aspectRatio":1.5015015015015014,"src":"/static/8f4ca0c6da5c328ef82798f91120001a/a41d1/cover.jpg","srcSet":"/static/8f4ca0c6da5c328ef82798f91120001a/0f3a1/cover.jpg 500w,\n/static/8f4ca0c6da5c328ef82798f91120001a/a7715/cover.jpg 1000w,\n/static/8f4ca0c6da5c328ef82798f91120001a/a41d1/cover.jpg 2000w,\n/static/8f4ca0c6da5c328ef82798f91120001a/b2131/cover.jpg 3000w,\n/static/8f4ca0c6da5c328ef82798f91120001a/d2452/cover.jpg 4000w,\n/static/8f4ca0c6da5c328ef82798f91120001a/eb6be/cover.jpg 5530w","sizes":"(max-width: 2000px) 100vw, 2000px"}}}}}}}