Skip to content

Instantly share code, notes, and snippets.

@julienma
Last active January 19, 2017 18:22
Show Gist options
  • Save julienma/4559907 to your computer and use it in GitHub Desktop.
Save julienma/4559907 to your computer and use it in GitHub Desktop.
Collection of useful OSX commands.
### Move a directory out of an existing repo, and push it to its own repo, keeping only relevant commits:
See http://teach.github.com/articles/lesson-filter-branch/
// turn any directory into your web server directory
$ python -m SimpleHTTPServer 8080
// open Google Chrome with the flag to disable Same-Origin Policy (and allow for cross-domain requests)
$ open -a Google\ Chrome --args --disable-web-security
// keeping your dev environment updated -- http://railsapps.github.io/installing-rails.html
// 1. update Xcode components
// open Xcode > Preferences > Download > Make sure that "Command Line Tools" is installed
// 2. update homebrew package
$ brew update
$ brew doctor
// 3. update RVM
$ rvm get stable
// 4. make sure that your environment has all requirements
$ rvm requirements
// 5. update ruby (will REPLACE current ruby)
$ rvm upgrade <current_version> <new_version>
$ rvm use <new_version>
// 6. update gemset
$ gem update --system
// 7. install rails (or any other gems) if necessary
$ gem install rails
$ gem install compass
// 8. update gems
$ gem update
// 8bis. in case of failure when updating a gem, cleanup and update again
$ sudo gem cleanup
$ gem update
// 9. update nodejs
$ nvm ls-remote
$ nvm install <new_version>
$ nvm alias default <new_version>
// copy node package from previous version
$ nvm use default
$ nvm copy-packages <previous_version>
// 10. install Yeoman
$ npm install -g yo grunt-cli bower
// 11. update Yeoman and other global NPM packages
$ npm update -g
$ npm prune -g
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment