-
Open the Terminal
-
Use
mysqldump
to backup your databases -
Check for MySQL processes with:
ps -ax | grep mysql
-
Stop and kill any MySQL processes
-
Analyze MySQL on HomeBrew:
brew remove mysql
HTTP status code symbols for Rails | |
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings. | |
Status Code Symbol | |
1xx Informational | |
100 :continue | |
101 :switching_protocols | |
102 :processing |
This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :
===Install Octopress=== | |
git clone git://github.com/imathis/octopress.git | |
cd octopress | |
gem install bundler rake --no-rdoc --no-ri | |
bundle install | |
rake install | |
===Start Blogging=== |
It looks as though using Release Phase commands (available as of 2 June 2016) is the preferred way of running things like migrations after the slug has been compiled and deployed.
The Buildpack API explicitly suggests avoiding side effects during the build:
Buildpack developers should avoid generating side effects during the build. For example, it is not recommended to perform database migrations in the compile script.
The following example creates a Rails app with a single migration and demonstrates that the migration is run after deployment.
# Create empty Rails app
I say "animated gif" but in reality I think it's irresponsible to be serving "real" GIF files to people now. You should be serving gfy's, gifv's, webm, mp4s, whatever. They're a fraction of the filesize making it easier for you to deliver high fidelity, full color animation very quickly, especially on bad mobile connections. (But I suppose if you're just doing this for small audiences (like bug reporting), then LICEcap is a good solution).
#/usr/bin/env bash | |
# MIT © Sindre Sorhus - sindresorhus.com | |
# git hook to run a command after `git pull` if a specified file was changed | |
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`. | |
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)" | |
check_run() { | |
echo "$changed_files" | grep --quiet "$1" && eval "$2" |
#/usr/bin/env bash | |
# MIT © Sindre Sorhus - sindresorhus.com | |
# forked by Gianluca Guarini | |
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)" | |
check_run() { | |
echo "$changed_files" | grep -E --quiet "$1" && eval "$2" | |
} |
map and collect are same http://stackoverflow.com/questions/5254732/difference-between-map-and-collect-in-ruby | |
http://matthewcarriere.com/2008/06/23/using-select-reject-collect-inject-and-detect/ | |
1. Use select or reject if you need to select or reject items based on a condition. | |
2. Use collect if you need to build an array of the results from logic in the block. | |
3. Use inject if you need to accumulate, total, or concatenate array values together. | |
4. Use detect if you need to find an item in an array. | |