Skip to content

Instantly share code, notes, and snippets.

@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 / Git Tag.md
Created February 21, 2014 08:45
Git Tagging

Git Tagging

  • Git tagging is like a mark where you mark a specific commit so that you can track how many commits ahead you are from that mark (tag)
  • A tag can only mark a commit, not multiple commits
# commit something first

# tag a commit (will tag last commit)
git tag -a v1.0 -m 'An intelligent message'
@stevenyap
stevenyap / Apache.md
Created February 21, 2014 08:51
Apache Configuration and more

Subdomain setup

# Note that you may want to uncomment NameVirtualHost *:80 in /etc/httpd/conf/httpd.conf to unset warnings for conflicted *:80

Listen 801
Listen 802
Listen 803
Listen 804
@stevenyap
stevenyap / Internet Explorer.md
Created February 21, 2014 08:48
Internet Explorer Testing
  • Download VirtualBox from http://virtualbox.org/
  • Download the IE versions from http://modern.ie/
  • Follow the instructions from Modern.ie to extract the OVA file
  • Open VirtualBox and select "File" > "Import Appliance"
  • Select the OVA file
  • ENSURE 'Reinitialize the MAC address of all network cards' is checked
  • Start up the Virtual Machine after you have imported the OVA
  • In Windows, open Internet Explorer
  • Go to http://10.0.2.2:3000 to access your Rails server
@stevenyap
stevenyap / Bootstrap v3.md
Created February 21, 2014 08:48
Bootstrap v3

Useful links:

Adding Bootstrap to Rails

  • Download Bootstrap
  • Copy bootstrap/dist/css/bootstrap.css and bootstrap/dist/css/bootstrap.min.css to vendor/assets/stylesheets
  • Copy bootstrap/dist/js/bootstrap.js and bootstrap/dist/js/bootstrap.min.js to vendor/assets/javascripts
  • Update app/assets/stylesheets/application.css *= require bootstrap
  • Update app/assets/javascripts/application.js //= require bootstrap
@stevenyap
stevenyap / NTFS Writing.md
Created February 21, 2014 08:47
Writing files to a NTFS hard disk or thumb drives

This resolves the issues of writing files to NTFS disks on mac.

  • Plug in your drive
  • Run the script below (Replace DRIVENAME with your drive name)
  • Unplug your drive and plug it in again
  • You won't see your drive on the desktop or finder
  • Type open /Volumes and you will be able to see your drive
  • Write your files!!!

Tip: To unmount the disk, type diskutil unmount /Volumes/DRIVENAME

@stevenyap
stevenyap / LiveReload.md
Created February 21, 2014 08:46
Live Reload to test your CSS instantly in browsers
@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 / GenyMotion Android Emulator.md
Created February 25, 2014 11:20
GenyMotion Android Emulator - Setup an android environment on Mac using VirtualBox
@stevenyap
stevenyap / HTML5.md
Created February 25, 2014 12:31
HTML5