Skip to content

Instantly share code, notes, and snippets.

View epintozzi's full-sized avatar

Erin Pintozzi epintozzi

View GitHub Profile
@epintozzi
epintozzi / erin-prework.md
Last active August 4, 2016 20:13 — forked from mbburch/prework.md
An example template for your Turing pre-work Gist

Turing School Prework - Erin

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:

Module 1 Week 1 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. Fill in your answers on a second sheet of paper or in your notebook. In cases where the question mentions a "given" data value, use the variable given to refer to it (instead of re-writing the information).

@epintozzi
epintozzi / rails_projects_and_testing.md
Last active January 31, 2017 20:09 — forked from JStans12/gist:86963b733db3060ed276f35447615253
Setting up rails and testing

Generate a new project without the included testing and with a postgres database:

rails new MyApp --skip-turbolinks --skip-spring -T --database=postgresql

Add VCR

group :test do
  gem 'vcr'
  gem 'webmock'

Instructions

  • Fork this gist
  • Do 5 JavaScript exercisms
  • Compare your completed exercises to five answers that other folks got, writing a comment of what you saw when comparing the answer
  • Fill in the template below with your work

My Submission

Do 5 of these:

Advanced Active Record Workshop

Overview & Learning Goals - 3 min

  • Diagram database relationships.
  • Identify the tables in a database that hold information required to complete complex queries.
  • Generate complex ActiveRecord queries using joins, group, order, select, and merge.
  • Use the rails dbconsole and rails console to generate ActiveRecord queries.

Background Workers with Sidekiq

Sidekiq Docs

Learning Goals

  • What is a background worker and when do we want to use one
  • How to implement a basic background worker with Sidekiq

Intro

1. Still a little unsure about how the JSON should be rendered for total unshipped revenue

I’m pretty sure we could pass the results of this AR query to an InvoiceSerializer:

class Api::V1::RevenueController < ApplicationController
  def show
    render json: InvoiceSerializer.new(Invoice.unshipped_revenue(quantity = 10))
  end
end