Skip to content

Instantly share code, notes, and snippets.

View iqbalhasnan's full-sized avatar
:shipit:
shipit

Iqbal Hasnan iqbalhasnan

:shipit:
shipit
  • Kuala Lumpur, Malaysia
  • 09:37 (UTC +08:00)
View GitHub Profile
@iqbalhasnan
iqbalhasnan / Capistrano 3.md
Created August 17, 2016 13:18 — forked from stevenyap/Capistrano 3.md
Capistrano 3 Setup

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
@iqbalhasnan
iqbalhasnan / tmux-cheatsheet.markdown
Created June 15, 2016 04:21 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@iqbalhasnan
iqbalhasnan / capybara cheat sheet
Created April 28, 2016 03:43 — forked from zhengjia/capybara cheat sheet
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')
@iqbalhasnan
iqbalhasnan / spree_backend_install.md
Created November 14, 2015 11:34 — forked from huoxito/spree_backend_install.md
Spree backend install

Set up a Spree backend only install

rails new store-backend

Gemfile

gem 'spree_backend', github: 'spree/spree'
:+1:
:-1:
:airplane:
:art:
:bear:
:beer:
:bike:
:bomb:
:book:
:bulb:
@iqbalhasnan
iqbalhasnan / Gemfile
Last active August 29, 2015 14:07 — forked from Joseph-N/Gemfile
source 'https://rubygems.org'
# default gems here
#---------------------------
# add paperclip and bootstrap
gem "paperclip", "~> 4.1"
gem 'bootstrap-sass', '~> 3.1.1'
module RedisHelper
# decode Redis value back to Ruby object
def self.decode(json)
self.new(ActiveSupport::JSON.decode(json)["#{self.name.downcase}"])
end
# encode Ruby object for Redis
def encoded
self.updated_at = nil
self.to_json

Deploy Rails app to digitalocean with nginx, unicorn, capistrano & postgres

Create droplet of your liking (ubuntu 12.10 x32)

ssh to root in terminal with your server ip

ssh root@123.123.123.123

Add ssh fingerprint and enter password provided in email