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 / AWS-CLI.md
Created February 21, 2014 08:50
AWS S3 Command Line
@stevenyap
stevenyap / Whenever.md
Created February 21, 2014 08:50
Whenever - Simplify your cron job!

This gem makes creating cron jobs very easy!

Sample schedule.rb

set :output, {:standard => 'log/cron.log'} #logs to your log file to view
@stevenyap
stevenyap / RailsAdmin.md
Created February 21, 2014 08:49
Rails Admin

Extracting model configuration

# app/models/booking.rb
class Booking
  include RailsAdmin::Booking
end

# app/models/concerns/rails_admin/booking.rb
module RailsAdmin::Booking
@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 / 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 / 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 / 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 / Mina.md
Created February 21, 2014 08:45
Mina - Faster deployment than Capistrano!!!
@stevenyap
stevenyap / POW.md
Created February 21, 2014 08:43
POW deployment server

This allows you to access the development server of your app without starting rails server. This means you can access multiple development site at the same time. Useful if you have an API app and another app to work together with.

Setup

# install
curl get.pow.cx | sh