Skip to content

Instantly share code, notes, and snippets.

View anoobbava's full-sized avatar
🎯
Focusing

Anoob Bava anoobbava

🎯
Focusing
View GitHub Profile
@anoobbava
anoobbava / mina
Created June 7, 2018 19:03 — forked from Yukaii/mina
rails 4.1.0 -- mina + unicorn + nginx
# config/deploy.rb
require 'mina/bundler'
require 'mina/rails'
require 'mina/git'
require 'mina/rvm'
# ter_mode 这个要设置,不然在 mac 下输密码有问题
set :term_mode, nil
set :rvm_path, '/usr/local/rvm/bin/rvm'
@anoobbava
anoobbava / deploy.rb
Created May 31, 2018 11:07 — forked from duykhoa/deploy.rb
Mina deploy with Puma task, support `start, stop, restart` feature, use `pumactl`. Thanks this tutorial for saving my life: http://ruby-journal.com/how-to-setup-rails-app-with-puma-and-nginx/
require 'mina/bundler'
require 'mina/rails'
require 'mina/git'
require 'mina/rvm' # for rvm support. (http://rvm.io)
set :domain, 'deploy@host'
set :repository, 'git...
set :branch, 'master'
set :shared_paths, ['config/database.yml', 'config/application.yml', 'log', 'tmp/sockets', 'tmp/pids']
@anoobbava
anoobbava / users_controller.rb
Last active May 28, 2018 13:54
users controller for delayed_job recurring example
class UsersController < ApplicationController
def new
@user = UserInformation.new
end
def index
@users = UserInformation.all
end
@anoobbava
anoobbava / rails http status codes
Created April 24, 2018 18:18 — forked from mlanett/rails http status codes
HTTP status code symbols for Rails
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
@anoobbava
anoobbava / rm_mysql.md
Created April 19, 2018 15:23 — forked from vitorbritto/rm_mysql.md
Remove MySQL completely from Mac OSX

Remove MySQL completely

  1. Open the Terminal

  2. Use mysqldump to backup your databases

  3. Check for MySQL processes with: ps -ax | grep mysql

  4. Stop and kill any MySQL processes

  5. Analyze MySQL on HomeBrew:

brew remove mysql

@anoobbava
anoobbava / MySQL_macOS_Sierra.md
Created April 19, 2018 15:22 — forked from nrollr/MySQL_macOS_Sierra.md
Install MySQL on Sierra using Homebrew

Install MySQL on macOS Sierra

This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.

Install MySQL

At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :

To compress a folder

tar -zcvf tar-archive-name.tar.gz source-folder-name

To un-compress a tar.gz

tar -zxvf tar-archive-name.tar.gz

@anoobbava
anoobbava / Octopress Blogging
Last active April 3, 2018 09:46 — forked from og-shawn-crigger/Octopress Blogging
A note for Octopress
===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===
@anoobbava
anoobbava / cloudinary.yml
Created March 28, 2018 06:40
sample file for cloudinary
---
development:
cloud_name: cloud_name
api_key: 'api_key'
api_secret: api_secret
enhance_image_tag: true
static_image_support: false
production:
cloud_name: cloud_name
api_key: 'api_key'

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