Skip to content

Instantly share code, notes, and snippets.

View dtinianow's full-sized avatar

David Tinianow dtinianow

View GitHub Profile
@dtinianow
dtinianow / dt-prework.md
Last active May 9, 2016 02:20 — forked from mbburch/prework.md
David's Turing pre-work Gist

Turing School Prework - David Tinianow

Task A- Practice Typing:

  • screenshots of scores will be posted in comments

Task B- Algorithmic Thinking & Logic:

  • screenshots of completed sections will be posted in comments

Task C- Create your Gist:

@dtinianow
dtinianow / week_3.markdown
Last active May 26, 2016 17:42 — forked from worace/week_3.markdown
Module 1 Week 3 Diagnostic

Module 1 Week 3 Diagnostic

This exercise is intended to help you assess your progress with the concepts and techniques we've covered during the week.

For these questions, write a short snippet of code that meets the requirement. In cases where the question mentions a "given" data value, use the variable given to refer to it (instead of re-writing the information).

Project workflow:

  1. Load/Reload waffle.
  • Find all tasks
  1. Choose a card from the backlog in waffle. If we're working separately, it's best to move that card that you've chosen into ready and perhaps assign it to yourself as well.
  • Pick out a specific task to work on
  1. git checkout master
  • Make sure you are on the master branch
  1. git pull origin master
  • Retrieve the most up-to-date version of the project
  1. run rspec
What is a primary key?

Totally unique identifier for a table A primary key automatically generates and increments from previous record (never reused)

What is a foreign key?

A primary key of a table that is used in another table to relate the two tables

Why would one row of data have both primary and foreign keys?
What is Rails' convention for the column name of the primary key?

id

What is Rails' convention for the column name of a foreign key?

foreign_table_id

Setting Group Expectations

Group Member Names:

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?

Pat - Doing meet and greet this weekend and moving to Denver next weekend. Good at remote work. Pat will be here from 9-4. Pending weekend hours. Will check in again on Friday re weekend. More inclined to work in the morning.

Yoseph - Wants to attend to meetups. Usually occur at 5-6. Will give us 24 hour notice. Arrives at 7, no time restriction to leave.

  • What does it mean to concatenate files? Find an image of an example concatenated file. Why would we want to concatenate files?

Take contents from all files and puts them together in one file

  • What does it mean to precompile files? What does this have to do with coffeescript and sass files?

Takes abstractions of languages (ie SASS and Coffeescript) and preprocess them down into native languages (CSS & Javascript)

  • What does it mean to minify files? Find an image of an example minified file. Why would we want to minify files?
@dtinianow
dtinianow / running_app_in_production_locally.markdown
Last active August 3, 2016 21:51 — forked from rwarbelow/running_app_in_production_locally.markdown
How to Run a Rails App in Production Locally
  1. Add gem 'rails_12factor' to your Gemfile. This will add error logging and the ability for your app to serve static assets.
  2. bundle
  3. Go to into database.yml and change username to the name of your computer (type whoami into command line)
  4. Run RAILS_ENV=production rake db:create db:migrate db:seed
  5. Run rake secret and copy the output
  6. From the command line: export SECRET_KEY_BASE=output-of-rake-secret
  7. To precompile your assets, run rake assets:precompile. This will create a folder public/assets that contains all of your assets.
  8. Run RAILS_ENV=production rails s and you should see your app.

Remember to clobber your assets (rake assets:clobber) and re-precompile (rake assets:precompile) if you make changes.

@dtinianow
dtinianow / rails_setup.md
Created October 3, 2016 19:37 — forked from ryanflach/rails_setup.md
Common setup for a new Rails project
  1. rails new <project_name> -d postgresql --skip-turbolinks --skip-spring -T
  • -d postgresql sets up the project to use PostgreSQL
  • --skip-turbolinks & --skip-spring creates a project that does not use turbolinks or spring
  • -T skips the creation of the test directory and use of Test::Unit
  1. In the Gemfile:
  • Available to all environments:
    • gem 'figaro' - store environment variables securely across your app (docs)
    • Uncomment gem 'bcrypt', '~> 3.1.7' if you will be hosting your own user accounts with passwords (docs)
  • Inside of group :test:
    • gem 'rspec-rails' - user rspec in place of minitest (docs)