Skip to content

Instantly share code, notes, and snippets.

View duykhoa's full-sized avatar

Kevin Tran duykhoa

View GitHub Profile
@duykhoa
duykhoa / GJviA.markdown
Created July 24, 2014 09:44
A Pen by duykhoa.
@duykhoa
duykhoa / Tearable-Cloth.markdown
Created July 29, 2014 09:15
A Pen by suffick.
@duykhoa
duykhoa / paperclip_storage_option.rb
Last active August 29, 2015 14:15
Custom paperclip storage in model
module PaperclipStorageOption
module ClassMethods
def options
Rails.env.production? ? production_options : default_options
end
private
def production_options
{
@duykhoa
duykhoa / gist:2ce3b538185118dc9d1a
Last active August 29, 2015 14:16
wufoo contact form
* {
font-family: "Lato", Arial;
}
header#header {
display: none;
}
input {
color: #676767;
font-size: 11px;
@duykhoa
duykhoa / kaminari-question.md
Last active August 29, 2015 14:17
Kaminari basic

Kaminari (Coding)

###A. Support part

####1. extend, include.

Ex1:

module A

Setup

git clone <repo>

clone the repository specified by ; this is similar to "checkout" in some other version control systems such as Subversion and CVS

Add colors to your ~/.gitconfig file:

@duykhoa
duykhoa / tmux_copymode_list.md
Last active May 18, 2020 13:10
tmux copy mode list

###How to use enable vi mode Here

Press prefix and '['. Ex: Ctrl B [

I use Ctrl A for prefix

###My recommend

After go to vi mode prefix [

@duykhoa
duykhoa / model_convention.md
Created April 19, 2015 04:23
rails model conventions

Base on rails guide

  1. module include, extend
  2. scope (default first, then other scopes)
  3. constant
  4. attr
  5. association
  6. validate
  7. callback
  8. method
@duykhoa
duykhoa / hero.rb
Last active August 29, 2015 14:19
class Traxex < Hero::RangedAgilityHero
# many things above
# ....
def normal_attack
arrow_shoot(base_damage)
end
def frost_arrows_attack
@is_iced_stun_affected = true
class Traxex
# st above
def attack
# do st
end
end
class AttackDecorator
def initialize(hero_object)