Skip to content

Instantly share code, notes, and snippets.

View rosiehoyem's full-sized avatar

Rosie Hoyem rosiehoyem

View GitHub Profile
class Plastic
def initialize
@plastic_bin = []
@plastic_types = ["num_1", "num_2", "num_3", "num_4", "num_5", "num_6", "num_7"]
end
def recycle_plastic(trash)
self.plastic_bin << trash if plastic_types.include?(trash)
end
end
@rosiehoyem
rosiehoyem / blog-round-up.md
Last active December 26, 2015 00:09
Blog Post

#Week 4 Blog Round-up!

Here at the Flatiron School we are encouraged to actively blogged. We are also required to present one blog post every week or two to the group. So much interesting stuff has been coming from my classmates, I decided to do a weekly round-up of some of my favorite posts. Here are handful of interesting posts from the past week:

Charlote Chang In her post, Variable Scope: How I Learned to Stop Worrying and Love the Ruling Class, Charlotte dives into variable scope and the politics of health care. It's entertaining and informative not mention beautifully designed.

Trevor McKendrick 10 Ruby Tricks is nice list of new Ruby bits that I hope to incorporate into my coding immediately. How logical to set default attribute accessors with an attr_acce

@rosiehoyem
rosiehoyem / blog-round-up-5.md
Last active December 26, 2015 03:39
Week 5 Blog Roundup

Anders What I Learned from Shipping my First Gem This past weekend Sonja and Charlotte and I shipped our first gem, so it was interesting to hear someone else's experience also. Anders created a simple weather gem to get a super basic weather report at the command line. Check it out: [Simple Forcast[(https://rubygems.org/gems/simple_forecast)

Another interesting bit that came from our disucssion was the immense utility of another gem, Chronic](http://chronic.rubyforge.org/)

Daniel Chang I had to include Daniel's post on Ruby Exceptions because these are things that have been confusing me as of lately. Not any more!

And a quick honable mention for Manley's post on Bash Shortcuts.

@rosiehoyem
rosiehoyem / testing.md
Last active December 26, 2015 18:58
Testing Articulated by an Energy Nerd

We started working with tests at the Flatiron School in week two. Every week tests have grown in complexity and we've encorporated new tools into our repetoir. We are now we're now in our 6th week and I decided it was time to break it down and do a full inventory of tools. This more for my own benefit than the world at large, but maybe others will find it useful also.

##What is testing? Software testing is an investigation conducted to provide stakeholders with information about the quality of the product or service under test. (Thanks Wikipedia). Even more than this simple definition, we do (Test Driven Development (TDD))[http://ruby.about.com/od/advancedruby/a/tdd.htm], which means we write our tests before we write out code, then write code to pass the tests. This, of course, mean that tests are very important to development to sucess of writing quality software. First, lets zoom way out to get some larger context from the industry (Rubiests didn't invent t

@rosiehoyem
rosiehoyem / _.md
Created February 11, 2014 18:59
Solar Production Data
@rosiehoyem
rosiehoyem / apis
Last active August 29, 2015 14:09
API Best Practicies
#API Best Practices
##Routes
Restricting Routes
resources :zombies, only: [:index, :show]
resources :humans, except: [:destroy, :edit, :update]
##Subdomain
Keeping our API under its own subdomain allows load balancing traffic at the DNS level.
resources :zombies, constraints: { subdomain: 'api' }
resources :humans, constraints: { subdomain: 'api' }
@rosiehoyem
rosiehoyem / testing_with_rspec
Created November 11, 2014 02:19
Testing Best Practicies
#Testing Best Practices
##Unit Testing with Rspec
Rspec Core Syntax
Rspec Expectations
Rspec Matchers
@rosiehoyem
rosiehoyem / app_model_person.rb
Last active August 29, 2015 14:11
Ruby Transactions
class Person < ActiveRecord::Base
...
def destroy_door_access
if self.door_accesses.first
self.door_accesses.first.destroy
else
true
end
@rosiehoyem
rosiehoyem / digitize_step_model.rb
Last active August 29, 2015 14:11
Meta Programming: instance_variable_set() and instance_variable_get()
# /app/models/digitize_step
class DigitizeStep < ActiveRecord::Base
belongs_to :process_step
end
@rosiehoyem
rosiehoyem / app_controllers_digitize_steps_controller.rb
Last active August 29, 2015 14:11
Forms, Complex Data Models and AJAX
# /app/controllers/digitize_steps_controller.rb
...
responds_to :js
...
def form
end
...