View gist:dcd034a2ef300df65fe71baf3adafd4f
ERROR
dyld: Library not loaded: /usr/local/lib/libgmp.10.dylib
FIX
brew update && brew install gmp && rvm reinstall 2.2.5
View gist:5e859772e6014bc6e17630fe207001ba
1 ) remove /home/deployer/appName/repo
2 ) cap production deploy
View carrierwave.rb
# Before
CarrierWave.configure do |config|
config.storage = :fog
config.fog_credentials = {
:provider => "AWS",
:aws_access_key_id => ENV["S3_KEY"],
:aws_secret_access_key => ENV["S3_SECRET"],
:region => ENV["S3_REGION"]
}
config.fog_directory = ENV["S3_BUCKET"]
View option_groups_from_collection_for_select.rb
class Category < ApplicationRecord
has_many :types
end
class Type < ApplicationRecord
belongs_to :category
end
# Admin DSL. you need to pass the the selected type_id by passing the form object value.
f.input :category
View Capistrano 3.md

This guide explains the way to setup a production server using Capistrano.

Setup Capistrano on LOCAL

  • Capistrano is a development gem which assist the developer to run commands on the production server (something like a Heroku toolbelt)
  • Hence, it is installed and configured on developer's computer
# Gemfile

# Use Capistrano for deployment
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
View gist:18495b8cd60313f826acf980be85dd69
Exception in callback of async function: Error: Handler with name 'u' already exists.
Run this to fix above error:
meteor update iron:middleware-stack
View capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
View cisco_anny_connect.sh
# Connect
printf "USERNAME\nPASSWORD\ny" | /opt/cisco/anyconnect/bin/vpn -s connect HOST
# Disconnect
/opt/cisco/anyconnect/bin/vpn disconnect
View gist:f37a78a9f07f401b44bd
Failed to click element because of overlapping element
change
`page.find("#some_element").click`
to
`page.find("#some_element").trigger("click")`