Skip to content

Instantly share code, notes, and snippets.

View stevenyap's full-sized avatar
💭
Functionally-workable developer

Steven Yap stevenyap

💭
Functionally-workable developer
View GitHub Profile
@stevenyap
stevenyap / Database Migration.md
Created February 21, 2014 08:43
Database migration tips

Using the Rails way

# export the database
# use gem 'seed_dump'
# which writes all your data into db/seeds.rb
rake db:seed:dump

# import the database
# upload seeds.rb to server
@stevenyap
stevenyap / Vim.md
Created February 21, 2014 08:40
Vim

VIM Setup

  • Use macvim
  • brew install macvim --override-system-vim
    or install without macvim
  • brew install mercurial
  • brew install vim

VIM Bundles using vundle

@stevenyap
stevenyap / Macbook Setup.md
Last active December 31, 2015 00:29
Macbook Setup - Recipe to setup a macbook with Rails and everything...
@stevenyap
stevenyap / RVM.md
Created November 28, 2013 02:36
Ruby Version Manager - RVM guide to managing ruby versions and gemsets!

Installing RVM

# install RVM
curl -L https://get.rvm.io | bash -s stable

# runs RVM
source /etc/profile.d/rvm.sh

# Setups required files for RVM
@stevenyap
stevenyap / Ramp Up.md
Created November 26, 2013 01:52
Programmer Ramp up: A list of readings for programmers to ramp up
@stevenyap
stevenyap / Gem Development.md
Created November 23, 2013 06:29
Create a Gem
  • Assuming the gem is called rulers
bundle gem rulers

# edit rulers/rulers.gemspec to add your profile information to the gem

# Build and install the gem
gem build rulers.gemspec
gem install rulers-0.0.1.gem
@stevenyap
stevenyap / i18n.md
Created November 21, 2013 04:25
i18n Internationalization
# Files in the config/locales directory are used for internationalization
# and are automatically loaded by Rails. If you want to use locales other
# than English, add the necessary files in this directory.
#
# To use the locales, use `I18n.t`:
#
#     I18n.t 'hello'
#
# In views, this is aliased to just `t`:
@stevenyap
stevenyap / Server Setup.md
Created November 21, 2013 02:04
Server Setup for Rails: Guide to installing Apache, Passenger, RVM and Rails

This guide setup Apache2/Passenger/Ruby/Rails on a CentOS 6.4 LiveCD.
You can test it yourself using VirtualBox to run all the scripts - read VirtualBox.md for more info.

# install the necessary libraries
yum clean all
yum -y update
yum -y install curl-devel git sqlite-devel libxml2-devel
yum -y install libxml2 libxml2-devel libxslt libxslt-devel
yum -y install gcc-c++ readline-devel libyaml-devel libffi-devel openssl-devel libtool bison
@stevenyap
stevenyap / VirtualBox.md
Created November 20, 2013 11:01
Setup of VirtualBox with CentOS 6 for fast testing of deployment scripts

This guide shows the step to setup VirtualBox with CentOS 6 for your testing of deployment scripts on Rails.

Pre-requistions

  • You are using Mac

VirtualBox and CentOS 6.4 Installation

@stevenyap
stevenyap / Capistrano 2.md
Created November 20, 2013 09:34
Capistrano 2 Server Setup

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

Pre-requistions

  • CentOS 6
  • Root access with SSH
  • depot is the assumed name of the project in this guide. Please change it to your own project name.
  • Server is installed with Apache/Passenger/Bundler/RVM.
    Please refer to Server Setup.md gist for info on how to set it up.

Apache Config