Skip to content

Instantly share code, notes, and snippets.

View icorson3's full-sized avatar

Ilana Corson icorson3

View GitHub Profile
# requires pry, parser, and ast gems
#
# Running:
#
#  # running on an individual file (or pass multiple file names in)
#  ruby-rewrite --load 'insert_ruby_params_keyword.rb' -m spec/controllers/api/songs_controller.rb
#
#  # running on all the file individually. note: if a pry gets triggered you'll see it, but it won't give you
#. # control of the terminal, you'll need to use the previous command on the filed that fails.

Week One - Module 3 Recap

Fork this respository. Answer the questions to the best of your ability. Try to answer them with limited amount of external research. These questions cover the majority of what we've learned this week (which is a TON!).

Note: When you're done, submit a PR.

  1. What is json, what does it stand for, and why is it important?
  2. What kind of object is JSON in Ruby? How do we know it's JSON?
  3. What's the difference between joins and includes in ActiveRecord?
  4. What's an API?
@icorson3
icorson3 / Advanced Enums
Created January 5, 2017 16:08
Post snow day work
Ilana: https://github.com/icorson3/advanced_enums

Personal Branding - Week 1/Module 1

  • Create/update Linkedin
  • Create/update Resume (creddle.io is a good resource)
  • Have two Turing peers review (2 for Linkedin, 2 for Resume) and send feedback via Slack by Thursday 12/1
  • Update Linkedin and Resume based on feedback
  • Include peer feedback in the body of the email and attach resume as a PDF
  • Send Linkedin and Resume to Meg via email (mstewart@turing.io) by Friday 12/2 (midnight)
<?xml version="1.0" encoding="utf-8" ?>
<!-- SQL XML created by WWW SQL Designer, https://github.com/ondras/wwwsqldesigner/ -->
<!-- Active URL: http://ondras.zarovi.cz/sql/demo/ -->
<sql>
<datatypes db="mysql">
<group label="Numeric" color="rgb(238,238,170)">
<type label="Integer" length="0" sql="INTEGER" quote=""/>
<type label="TINYINT" length="0" sql="TINYINT" quote=""/>
<type label="SMALLINT" length="0" sql="SMALLINT" quote=""/>
<type label="MEDIUMINT" length="0" sql="MEDIUMINT" quote=""/>
  1. fix any axe violations on my turing arcade website.
  2. add the alt text to any where that i can.
  3. research color contrasts and how to avoid these violations.
  • I plan to attend startup week. Especially some of the diversity and mental health panels.
  • I would like to write about turing and our role in the community and how I feel about the Denver community as it stands.

List 5 companies you might want to apply for:

2 companies you think you'd like to work for 2 companies you don't really want to work for but that have a job posting somewhere you'd like to live 1 dream company (BaseCamp, Funny or Die, Github... somewhere it's hard to get hired but wouldn't that be cool, eh?) Don't say which is which though - just list 5.

For each company, answer the following questions:

CA Technologies

What's the total revenue for all items? select sum(revenue) from items; What's the average revenue for all items? select avg(revenue) from items; What's the minimum revenue for all items? select min(revenue) from items; What's the maximum revenue for all items? select max(revenue) from items; What the count for items with a name? select count(name) from items; What else can you pass to count and still get 5 as your result? select count(items) from items; Return all main courses. Hint: What ActiveRecord method would you use to get this? select items from items where(course = 'main'); Return only the names of the main courses. select name from items where(course = 'main'); Return the min and max value for the main courses. select max(revenue), min(revenue) from items where(course = 'main'); What's the total revenue for all main courses? select sum(revenue) from items where(course = 'main');

Notes:
  • In the response data: The response times should be unique.
  • The controller could be broken up into smaller components. We also have nested conditionals which says that we could restructure that section.
  • Some logic is in the controller that could be pulled out.
  • To make a robust test helper, we could do all the payload creation before bringing it to the test.
  • We are hard-coding the client id as well, which doesn't cause issues at the moment but could. Create the client when creating the payload and pass the actual client id in, not just the integer 1. This shows we are not using activerecord to its fullest potential.
  • By creating the entire payload outside of the test is less expensive than creating it in every test. We should also create and analyze the raw payload in the test helper before the test.
  • The test helper could also have a default payload and if we want to change specific attributes, we could pass them in instead of creating specific payloads for specific instances.