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 / Day.27md
Created February 17, 2016 02:23
codecore
#javascript
var count = function(string){
var newString = string.split(" ");
myObject = {};
for(var i = 0; i < newString.length; i++){
myObject[newString[i]] = newString[i].length
}
}
@dohoonk
dohoonk / day.28
Last active February 19, 2016 17:07
codecore
#TDD
association :user, Factorygirl: :user
bin/rails g migration add_user_references_to_campaigns user:references
RAILS_ENV=test
let(:pledge) {FactoryGirl.create(:pledge, {campaign: campaign, user: user})}
call pledge
@dohoonk
dohoonk / day.29
Last active February 21, 2016 01:31
codecore
#
gem rails-erd
brew install graphviz
bin/rake erd
--------------------------------

DOM

var filter = function(array, fn) {
  var result = [];
  arr.forEach(function(){
    if(fn(element)){
      result.push(element);  
 }
Rspec.feature "Campaigns", type: :feature do
describe "Campaigns Listing" do
it "displays a text 'Recent Campaigns'" do
#this simulates users typing the 'campaign_path' in the address bar
#to actually visit the page
visit campaigns_path
# we have acess to an object 'page' that contains the rendered HTML page
# we can use it with RSpec Matchers to perform tests
expect(page).to have text "Recent Campaigns"
end

gem 'simple_form'

-to work with bootstrap

rails generate simple_form:install --bootstrap

app/assets/stylesheets/bootstrap_and_overrides.scss @import "bootstrap-sprockets"; @import "bootstrap"

@dohoonk
dohoonk / CodecoreBoot5.md
Last active March 9, 2016 17:32
Navigating in Git

how to see branches git branch -v

how to build a brench git checkout -b intergration

git status on branch integration

git checkout -b

@dohoonk
dohoonk / day40.md
Created March 7, 2016 07:35
BootCamp

Big O notation

Binary Search is often offered as divide and conquer as the approach is often to take the middle and compare the values at that point. If the desired value does is greater than what is being compared you would ignore the first half of the values and take the last half and divide tht by half.

Recursion

@dohoonk
dohoonk / CodecoreBoot.md
Created March 7, 2016 19:51
Building API/Faraday

#Api vesion control

-bin/rails g controller api/v1/questions

will generate api folder and v1


faraday gem can mimic http request

@dohoonk
dohoonk / CodecoreBoot2.md
Last active March 8, 2016 18:49
Signing in with Twitter API/

Omniauth GEM

apps.twitter.com

in the twitter create an app

in the required url http://127.0.0.1:3000/ or lvh.me:3000