Skip to content

Instantly share code, notes, and snippets.

View Xavier-IV's full-sized avatar
🇩🇪
Currently in Germany

Zafranudin Zafrin Xavier-IV

🇩🇪
Currently in Germany
View GitHub Profile
@Xavier-IV
Xavier-IV / rails_cheatsheet.md
Last active July 23, 2023 12:25
Rails Cheatsheet

Migration Data Types

# Binary
$ rails generate migration AddImageDataToPhotos image_data:binary

# Boolean
$ rails generate migration AddIsActiveToUsers is_active:boolean

# Date

First, kau kena familiarkan diri dengan 3 servis AWS ni

  1. BEANSTALK (EB), untuk host kau punya website
  2. ROUTE 53, untuk beli domain dan routing
  3. EC2, ini kau punya VMWare, semua file ada dalam ni. Ini server Linux kau, ibarat kau punya Windows/Linux cuma takda desktop

Dalam EC2, ada Beanstalk. Beanstalk ni anak buah dia.

@Xavier-IV
Xavier-IV / application_helper.rb
Created June 22, 2017 13:24
Simple helper for Rails View to handle active class
module ApplicationHelper
# Most commonly used.
# If you have a ROUTE of :admin_home or admin_home_path,
#
# <li <%= set_active_if_path(admin_home_path) %>>
# <%= link_to :admin_home do %>
# <i class="fa fa-home"></i> <span>Dashboard </span>
# <% end %>
# </li>
@Xavier-IV
Xavier-IV / create.md
Last active August 25, 2016 22:43
Test file

This is from create