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 / Stripe.txt
Last active June 2, 2016 21:13
Stripe Integration
After setting up stripe account
grab the api key
1.
In your secrets.yml
stripe_secret_key: dsfadasfsadfsadfdsa
stripe_publishable_key: sdafdsafdsafdsafdsafsdaf

Create an account at Stripe 2. Account Setting/Api Key Grab your Api key here 3. Put your Key in secrets.yml as

stripe_secret_key: your key here
stripe_publishable_key: your key here
@dohoonk
dohoonk / CodecoreBoot12.md
Last active March 24, 2016 03:25
Performance

Performance improvement can be done in all levels

Browser View Controller Model/DB

prematurely adjusting the app for performance is not optimal as it will slow the development time

@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

@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 / 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 / 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

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 / 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 %>

#What is React.js?

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