Skip to content

Instantly share code, notes, and snippets.

View vanderhoop's full-sized avatar
💭
🤷🏻‍♂️

Travis Vander Hoop vanderhoop

💭
🤷🏻‍♂️
View GitHub Profile

Database and Table Setup/Maintenance

Creating a database

  • CREATE DATABASE db_name;

Deleting a database

  • DROP DATABASE db_name;

Creating a table:

require 'pg'
db_conn = PG.connect(dbname: 'shopping_db')
result = db_conn.exec(string_of_sql)
entry_as_hash = result[0] # yield a hash of the first row.
Explain what BDD/TDD is and its benefits. Compare it to "cowboy coding.
Explain what 'yield' does when called in a method
Draw an ERD for the following app using proper notation. A user can have zero or many blog posts, and each blog post can have zero or many comments.
Explain what a database is and why you would use one as opposed to other persistent storage mechanisms
Explain what a foreign key is and why you would use one
Give examples of use cases for Ruby's `.each`, `.select`, and `.map` methods.
Explain what a database 'constraint' is
What is a document outline?
Compare and contrast arrays and hashes and when you would use each
Explain what "auto-incrementing primary key" means for a database table

##WDI Project 1

The students' first projects are their opportunity to apply everything that they've learned in their first month of WDI. What they've covered:

  • Version control with Git
  • Programming Fundamentals with Ruby
  • TDD/BDD with RSpec
  • HTML/CSS
  • Rails

The students work invididually on a project of their own design. We stress development process and code quality, and we have implementation guidelines for the students to follow, all of which you can find below.

Common jQuery Methods

You just learned how to create jQuery objects. Now head into your sandbox and make use of the following methods. You'll have to look some of them up at MDN.

  • .text()
  • .html()
  • .attr()
  • .addClass()
  • .removeClass()
  • .toggleClass()

Git Workflow Ripest Tomatoes.

  1. Grab the SSH url at the ripest tomatoes github repo
  2. Enter git clone <the_ssh_url> in your dev directory
  3. cd into the rails project and create a new branch branch with git branch <yourname>
  4. Switch to your newly created branch git checkout <yourname>
  5. Do work.
  6. When teammates tell you they've pushed working changes to master, git checkout master and pull from origin.
  7. git checkout <yourname>
  8. git rebase master
@vanderhoop
vanderhoop / sublime_text_2_shortcuts_for_beginners.md
Last active August 29, 2015 14:03
Essential Sublime Text 2 Keyboard Shortcuts for Beginners

Sublime Text Keyboard Shortcuts

Shortcut Command
command + shift + p open command pallette
command + left arrow move cursor to the beginning of current line
command + right arrow move cursor to the end of current line
command + up arrow move cursor to the top line of the file
command + down arrow move cursor to the last line of the file
command + multiple mouseclicks create multiple cursors within file
option + mousedrag create multiple cursors along mousepath

Week 1 Day 1 Code Snippets

One of the most helpful tools when first learning to code is articulating in plain English what a puzzling piece of code does for you. This is because the act of researching and expressing the code's purpose in your own words helps ingrain that purpose in your mind. That said, your homework tonight is to identify the commands you used today and in your prework and mindfully break them down.

Objectives

  • develop a strategy for breaking down and documenting unfamiliar code
  • gain experience using Markdown, the open-source formatting language
  • gain practical experience using Git for version control
  • gain muscle memory for making frequent, sensible commits

Framing Your WDI Experience

You're all adults with 20+ years of experience as learners, and you know your learning patterns best. Your first homework assignment is to examine the entirety of your learning history to identify your perceived strengths and weaknesses as a student, so you can make the most of your experience in WDI.

Objectives

  • gain self-awareness as a student
  • get comfortable working in the command line
  • get practical experience using git for version control
  • gain muscle memory for making frequent, descriptive, present-tense commit messages as you progress
  • get your first taste of diving into unfamiliar documentation for new languages and tools (in this case, Markdown and Mou)

Setting Up A GitHub Repo for Hosting Hitherto Local Code

  1. First, you'll need a local repo with some committed code.
  2. Next, you'll have to create a repo on GitHub.com, which can be done by clicking on the plus sign next to your name and following the ensuing prompts.
  3. When the GitHub repo is created, it's still just an empty vessel. It knows nothing about your local code, and, similarly, your local code knows nothing about GitHub. To let the two talk to one another, we need to copy the ssh clone url (which is used to verify that you are who you say you are) found on the right side of the repo page before proceeding to step 5.
  4. Now add a remote repo with the following command: git remote add <repo_name> <branch_name> <ssh_clone_url> where <branch_name> is typically master and <repo_name> is whatever you choose, though it's common to call it origin.
  5. You can check to see if the remote repo was added correctly by using git remote -v
  6. If the remote was added, use `git push <remot