Skip to content

Instantly share code, notes, and snippets.

View jwo's full-sized avatar

Jesse Wolgamott jwo

View GitHub Profile
<ul>
{{#each color in model}}
<li>{{color}}</li>
{{/each}}
</ul>
@jwo
jwo / think-code-evaluate-refactor.rb
Created September 10, 2014 16:51
think-code-evaluate-refactor.rb
class Brain
def think; end
def code ; end
alias evaluate think
alias refactor code
end
brain = Brain.new
@jwo
jwo / scholastic.rb
Created August 12, 2014 15:05
scholastic.rb
class User
has_many :orders
attr_accessor :name
attr_accessor :devise
end
class Book
has_many :line_items
has_many :orders, through: :line_items
attr_accessor :title
@jwo
jwo / relationships.rb
Created August 11, 2014 17:45
TIYA review of relationships
class Order
has_many :line_items
has_many :cupcakes, through: :line_items
def total_price
totals = line_items.map(&:total) # 50, 50, 100
totals.sum
totals.inject(:+)
@jwo
jwo / car.rb
Created June 11, 2014 17:25
my day-3 homework (car)
class Car
attr_reader :front_wheels
def initialize
wheel = Wheel.new
wheel2 = Wheel.new
wheel3 = Wheel.new
wheel4 = Wheel.new
@front_wheels = [wheel, wheel2]
@jwo
jwo / my_brigade.rb
Created June 10, 2014 18:33
Super Flipping Sweet homework from The Iron Yard
my_brigade = {}
my_brigade[:Chef_de_Cuisine] = "the Head Chef in charge of the kitchen"
my_brigade[:Sous_Chef] = "2nd in Charge to the Chef de Cuisine"
my_brigade[:Saucier] = "who Prepares sauces, soups, and finishes dishes"
my_brigade[:Rotisseur] = "the Grill cook who prepares meat dishes"
my_brigade[:Poissonnier] = "the Cook in charge of fish dishes"
my_brigade[:Entremetier] = "the Cook in charge of Vegetable and Pasta Dishes"
my_brigade[:Garde_Manger] = "the Cook who prepares cold dishes, salads, and charcuterie"
my_brigade[:Tournant] = "the Cook who helps in any station as necessary"
my_brigade[:Patissier] = "the Cook who prepares deserts and sweet dishes"
@jwo
jwo / _form.html.erb
Created March 17, 2014 17:33
Possible Additions to Chapter 7.2 of Angularails
<div ng-app="AngulaRails" ng-controller="WidgetController" ng-init="setWidget(<%= @widget.to_json %>);">
<%= form_for @widget, id: "widgetForm", html: { name: "widgetForm", "novalidate" => true, "ar-submit" => true } do |f| %>
<% if @widget.errors.any? %>
<div class="alert alert-danger">
<h4><%= pluralize(@widget.errors.count, "error") %></h4>
<ul>
<% @widget.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
@jwo
jwo / wayCoolCtrl.js
Created March 4, 2014 22:18
wayCoolCtrl showing promises in Angular
greenvilleJS.controller('wayCoolCtrl', ['$scope', '$q', function ($scope, $q) {
$scope.address = "";
$scope.mapMarkers= [];
$scope.zoom = 8;
$scope.geoCoder = new google.maps.Geocoder();
$scope.mapCenter = function() {
return $scope.map.center;
};
@jwo
jwo / class-beginner.rb
Last active January 3, 2016 22:09
RubyOffRails - January 2014 Office Hours
class Automobile
@@autos = []
def self.count
@@autos.count
end
def self.autos_for_model(model_name)
@@autos.select{|auto| auto.model == model_name}
@jwo
jwo / zero-to-web-developer.md
Created December 19, 2013 17:55
From No Coding to Web Dev (a list)

From No Coding to Web Dev

I get asked frequently about how people should become a Ruby on Rails developer -- that's such a broad range of topics it's hard to give just one path. You not only need to learn how to program, but you need to master Ruby, JavaScript, databases, TDD, and at least a little bit of graphics design (CSS).

Here's my path to a great web and Rails developer:

  1. http://pragprog.com/book/ltp2/learn-to-program
  2. http://www.codecademy.com/tracks/web
  3. http://www.codecademy.com/tracks/javascript
  4. https://www.coursera.org/course/programming1