Skip to content

Instantly share code, notes, and snippets.

View SteveOscar's full-sized avatar

Steven Olson SteveOscar

View GitHub Profile
@SteveOscar
SteveOscar / cfu_crud_in_sinatra.markdown
Last active December 2, 2015 16:12 — forked from rwarbelow/cfu_crud_in_sinatra.markdown
CRUD in Sinatra -- Check for Understanding

. Define CRUD.

An acrnym for Create, Read, Update, Delete, refering to database operations.

. There are seven verb + path combinations that are necessary in a basic Sinatra app in order to provide full CRUD functionality. List each of the seven combinations, and explain what each is for.

-DELETE '/items/:id' -- used to delete a specific row from the database.
-PUT '/items/:id' -- used to update a row in the database.
-GET '/items/:id/edit' -- looks up the item to be updated.

@SteveOscar
SteveOscar / agile_dev.md
Created December 7, 2015 17:26
Agile Development

1: The agile methed focuses on iterations to quickly produce functional software, rather than tackling a whole project at once. Results are valued over the process.
2: Agile is probably so popular in the software world because both the developers and the clients are more satisfied with the process. Breaking a project down into managable iterations makes development less stressful, and quickly produces working software that the client can review.
3: Agile seems less appropriate for hardware-based projects, particularly allowing last-minute changes from the client. The specifications and functioinality of a rocket cannot be changed 75% through the process. Software is more felixble.

Setting Group Expectations

Group Member Names: Dan, Lenny, SteveO, BethS

  1. When are group members available to work together? What hours can each group member work individually? Are there any personal time commitments that need to be discussed? Not too late in the evening, usually leave by 8. Broncos.

  2. How will group members communicate? How often will communication happen, and how will open lines of communication be maintained? Slack @channel

  3. Which feature(s) does each group member want to work on? Which feature(s) does each group member not want to work on? Beth likes DB, Dan too, Steve too. Lenny does not like design. We will debrief one another on what we build.

Class Article < ActiveRecord::Base
has_many :article_newspapers
has_many :newspapers, :through => :article_newspapers
end
Class Newspaper < ActiveRecord::Base
has_many :article_newspapers
has_many :articles, :through => :article_newspapers
end
# First, the new join table, where 'taggable' establishes the polymorphic association.
class Tagging < ActiveRecord::Base #the join table
belongs_to :tag
belongs_to :taggable, :polymorphic => true #this line sets up polymorphism
end
# The tag model is associated with newspapers AND articles (polymorphism) via the join table.
class Tag < ActiveRecord::Base
has_many :newspapers, :through => :taggings, :source => :taggable,
:source_type => "Newspaper" # informs rails how to get to newspapers from tags
@SteveOscar
SteveOscar / basic_polymorphic.rb
Created December 30, 2015 18:06
Basic Polymorphic Association
class Tag < ActiveRecord::Base
belongs_to :taggable, polymorphic: true
end
class Article < ActiveRecord::Base
has_many :tags, as: :taggable
end
class Newspaper < ActiveRecord::Base
has_many :tags, as: :taggable
@SteveOscar
SteveOscar / github_shortcuts.md
Last active January 7, 2016 16:49
Github Shortcuts

'?' - brings up shortcut list
'g+d' - go to your dashboard
'g+c' - go to repo root
'j' - move selection down
'k' - move selection up
'o' - open selection
't' - open file finder for project
's' - put curser in search bar

###The Turing Firehose of Information
#How Mod2 is different from Mod1
-logic overload vs tools overload
-pros and cons
#Reactions of myself and classmates
-Not sure what to focus on
-Balancing keep up vs retention of past topics
-

GlobeSquatter (working title)

Pitch

A mapping application that allows a user to quickly see trends and current realtive expenses in countries around the world.

Problem

There are plenty of databases and static maps showing relative costs across countries, but it's hard to get a big-picture view without visiting multiple sites. Also, most reports and maps focus on USD and EUR as the base currencies. It's difficult for people earning more obscure currencies to find data from their perspective.

@SteveOscar
SteveOscar / 03-16-blog.md
Last active March 7, 2016 17:35
Building an interactive map using jVectorMap

Creating an Interactive Map With jVectorMap

Background

  • I've been using this JS library to build my mod-3 personal project.

Setting Up the Map

  • Downloading the correct files
  • Where to place the files in your Rails app