Skip to content

Instantly share code, notes, and snippets.

View ToniRib's full-sized avatar

Toni Rib ToniRib

View GitHub Profile
@ToniRib
ToniRib / setting_expectations.markdown
Last active January 11, 2016 17:31 — forked from rwarbelow/setting_expectations.markdown
Setting Expectations - Little Shop of Orders

Setting Group Expectations

Group Member Names: Toni Rib, Brenna Martenson, Taylor Moore

  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?
  • Toni: Tuesdays w/Toni 4:15-5:45pm, Thursday w/Alex 4-5pm, next Wed w/Alex 4-5pm, next Thurs w/mentor 5pm-7pm, Horace bitcoin 4pm-5pm
  • Taylor: mentor meeting at some point, probably Wed or Thurs
  • Brenna: friend in town on Thursday, dinner at some point with them
  1. How will group members communicate? How often will communication happen, and how will open lines of communication be maintained?
#!/usr/bin/env ruby
#You'd have to be very trusting to run this...
require "base64"
require 'pry'
string = "IyEvdXNyL2Jpbi9lbnYgcnVieQojWW91J3JlIGRvaW5nIHF1aXRlIHdlbGwu\nCnJlcXVpcmUgImJhc2U2NCIKZXZhbChCYXNlNjQuZGVjb2RlNjQoIkl5RXZk\nWE55TDJKcGJpOWxibllnY25WaWVRb2pUMjRnZEdobElISnBaMmgwSUhSeVlX\nTnJMaTR1Q25KbFxuY1hWcGNtVWdJbUpoYzJVMk5DSUtaWFpoYkNoQ1lYTmxO\nalF1WkdWamIyUmxOalFvSWtsNVJYWmtXRTU1XG5UREpLY0dKcE9XeGlibGxu\nWTI1V2FXVlJiMnBVTWpWcVdsTkNhRm95Um5CaWFYZG5XbGhvYWxwWGVITmFc\nblZ6VXdTVWhrZGx4dVkyMXpkVU51U214aldGWndZMjFWWjBsdFNtaGpNbFV5\nVGtOSlMxcFlXbWhpUTJoRFxuV1ZoT2JFNXFVWFZhUjFacVlqSlNiRTVxVVc5\nSmEydzFYRzVTV0ZwclYwVTFOVlJFU2t0alIwcHdUMWQ0XG5hV0pzYkc1Wk1q\nVlhZVmRXVW1JeWNGSlZNRXB3V2taa2Fsb3lSbGhPUjJSclVqSm9jMU5WWkU5\nY2JtUnNcbmNFaFdWMlJvVjBVeGJscEVTVFZsVm5oMVdrVmtibG95VWtsYVNG\ncEtVako0TVZOVmFGTmlNWEJVVVcxMFxuYVUxck5IaFpiR1JYWkZkU1NGeHVV\nbXBDYUZaNmJERlVSMlIzWlZad1dWSnFSbWhYUlhCelUxVk9TMkZXXG5iRmxV\nYlhoUFlXeEdjRmhITlVSaVZsbDVWMVprTTJJeFJuUlNibkJoWEc1V1JtdDNW\nRWN4VTJKR2EzbFBcblYzUmhWa1pyZDFNd1RrdFRiVlpXVm1

Toni Rib, Dan Winters, Joseph Perry

  1. What does it mean to concatenate files? Find an image of an example concatenated file. Why would we want to concatenate files?
  • When you concatenate files, you combine multiple files into one large file so you only have to make one request.
  1. What does it mean to precompile files? What does this have to do with coffeescript and sass files?
  • To put the files into a format that your browser can read prior to the browser requesting it. Coffeescript compiles to javascript and sass compiles to css.
  1. What does it mean to minify files? Find an image of an example minified file. Why would we want to minify files?
  • Remove all whitespaces and shorten any code that can be shortened. This makes the files much smaller so they load more quickly, but they also aren't human readable so you can't work in them that way.
  1. Start up the server for Catch 'em All (rails s) and navigate to http://localhost:3000/assets/application.js. Then open up the code for application.js in yo
@ToniRib
ToniRib / template.rb
Last active February 23, 2016 16:22
My working document for my rails application template
# Remove the gemfile so we can start with a clean slate otherwise Rails groups
# the gems in a very strange way
remove_file "Gemfile"
add_file "Gemfile"
prepend_to_file "Gemfile" do
"source \"https://rubygems.org\""
end
# Add all the regular gems
@ToniRib
ToniRib / .railsrc
Created February 15, 2016 22:01
My railsrc file
--skip-bundle
--skip-test-unit
--database=postgresql
--skip-turbolinks
--template=~/template.rb
@ToniRib
ToniRib / run_hacker_proposal.markdown
Last active February 29, 2016 18:35
Personal Project Proposal

Run Hacker

Pitch

Run hacker provides custom analytics and visualizations for runners who use MapMyRun to be able to analyze trends in their running so they can improve their performance.

Problem

There's a lot of data collected via various running applications but no good way to analyze trends across multiple runs to pinpoint areas that can be improved. The tools provided by the applications themselves are pretty rigid in that they don't allow customization and are generally only give you data for one run at a time.

@ToniRib
ToniRib / toni_rib_lightning_talk_concerns.md
Last active March 8, 2016 20:50
Lighting Talk Mod 3 - ActiveSupport::Concern

ActiveRecord::Concerns - How To Share Scopes/Class Methods Between Modules

Intro

  • What is that 'concerns' folder that lives under models that you always delete? Why does it exist? You're about to find out!
  • Mostly a code-along lightning talk
  • Background: You have a scope that needs to be shared across multiple models and you don't want to repeat your code
  • Example: Rails Engine -> successful_transactions scope for Merchant and Customer

Code Along

@ToniRib
ToniRib / javascript_exercisms.md
Last active March 15, 2016 18:18
JavaScript Exercisms

Leap

My Code

Other Solutions

  1. Solution 1 - This person used an if/else statement to return true or false. It's actually unnecessary since the logical expression itself will return true or false. They could remove that and get rid of some lines of code.
  2. Solution 2 - This person did the same thing as solution 1. I also think they could refactor to pull out the logical statement into its own function to clean up the code.
  3. Solution 3 - This person had an interesting approach to the code by creating divisible variables to help the reader understand what is going on in the logical expression. I actually like this a lot as I think it makes it easier to read and cleans up the logical expression. However they could simplify line 8 by r
@ToniRib
ToniRib / sandi_metz_reflections.md
Created March 18, 2016 14:41
Sandi Metz's Rules for Developers Reflections

Which of Sandi's rules do you feel like might be the hardest to follow—why?

Rules

I feel like the 5 lines per method is the hardest to follow. In general, I have been trying to follow this rule since about halfway through mod 1, mostly with success, but sometimes I just can't find a way around it. They are correct in that I usually get stuck when I have an if/else situation in which it's difficult to pair down the internals to one line each. However, I also find it difficult to stay under 100 lines in a class sometimes when I have a class that I have a lot of methods for. I think I just need to spend more time refactoring classes to have a single responsibility to meet this rule.

@ToniRib
ToniRib / javascript_reflections.md
Last active March 18, 2016 15:56
Speaking JavaScript Reflections
  • By far the most interesting thing I read was this: "JavaScript did not have exception handling until ECMAScript 3. That explains why the language so often fails silently and automatically converts the values of arguments and operands: it initially couldn’t throw exceptions." WHAT?? It literally couldn't throw exceptions until ES3? Why on earth would it be designed that way?
  • A lot of JavaScript seems like workarounds built on top of workarounds. I don't like that.
  • The concept of 'bind' seems flexible/useful but also confusing as it's a totally new concept to 'bind' one function to another. I don't yet see the benefit over just defining another function.
  • I skimmed the arguments section. It didn't seem that useful or interesting.
  • The reading made the concept of 'hoisting' a lot clearer for me.
  • I skimmed 'Use Cases for Window' because: "This section describes use cases for accessing global variables via window. But the general rule is: avoid doing that as much as you can."
  • The environments section