Skip to content

Instantly share code, notes, and snippets.

View dohoonk's full-sized avatar
🎯
Focusing

Tony(Dohoon) Kim dohoonk

🎯
Focusing
View GitHub Profile
@dohoonk
dohoonk / Gem Collection
Last active March 15, 2016 21:03
Collection of useful Gems
gem "cocoon"
gem 'kaminari'
gem 'bootstrap-kaminari-views'
gem 'cancancan'
gem 'friendly_id', '~> 5.1.0'
gem 'delayed_job_active_record'
gem 'delayed_job_web'
gem 'quiet_assets'
gem 'font-awesome-rails'
gem 'simple_form'
@dohoonk
dohoonk / CodecoreBoot3.md
Last active March 9, 2016 00:19
Debugging

#Steps to debug 1.Read the error message multiple times Where do I find the message? Read and Read and Read

2.Google the error message copy and paste to google the error msg

3.User tools Railslogger

@dohoonk
dohoonk / CodecoreBoot4.md
Last active March 10, 2016 06:06
Edditing in Git/Final Project/Taste of Node Js/Mongo db

#Peer review in Git Reset the master in history and make a pull request

look at the code and add comments

git reset example --hard git log git push -f origin master

review and add comments on the code

#What is React.js?

client side With few core concepts you can build a fully functional application

@dohoonk
dohoonk / CodecoreBoot7.md
Last active March 15, 2016 21:16
dynamic _form/ cocoon gem

This line of code in campaign model will allow users to feed data about rewards accepts_nested_attributes_for :rewards, reject_if: :all_blank

_form.html.erb

<%= f.simple_fields_ for :rewards do |r| %> <%= r.input :title%> <%= r.input :amount%> <% end %>

bin/rails g controller my_campaigns

resources :my_campaigns, only: [:index]

<%=link_to "My projects", my_campaigns_path%>

before_action :authernticate_user

def index @campaigns = current_user.campaigns

@dohoonk
dohoonk / CodecoreBoot8.md
Last active March 17, 2016 21:09
Geocoder/

example of fundsy

gem "geocoder"

You have to turn the address into longetude and latitude

rails generate migration AddLatitudeAndLogitudeToModel(name) latitude:float longitude:float
@dohoonk
dohoonk / CodecoreBoot9.md
Created March 17, 2016 22:15
Active Admin/alternative to ERB

##Active Admin

This will fetch the latest from git

gem 'activeadmin', github: "activeadmin/activeadmin"

active admin depends on gem 'devise'

@dohoonk
dohoonk / CodecoreBoot10.md
Last active March 19, 2016 23:42
Handling background job with Redis and Sidekiq/Polymorphic associations

##Delayed Job/Backgorund Job

1 brew install redis

2 To start the server redis-server

3

@dohoonk
dohoonk / CodecoreBoot11.md
Last active March 22, 2016 22:04
Presentation Logic

draper gem

gem 'draper' in your gemfile

bundle

You generate a decorator for a specific object