Try Git | Markdown Cheatsheet | Pro Git | Git Config
Getting Started
In the terminal start by creating a new directory, then run git init
to initialize a git repository
Fee = Struct.new(:percentage, :max, :min) | |
# # equivalent to | |
# class Fee | |
# attr_accessor :percentage, :max, :min | |
# def initialize(percentage, max, min) | |
# self.percentage = percentage | |
# self.max = max | |
# self.min = min | |
# end |
require 'spec_helper' | |
describe HomepageController do | |
describe "#index" do | |
it "is successful" do | |
get :index | |
expect(response).to be_success | |
end | |
end |
# What's the difference between procs and lambdas? | |
# | |
# To really understand the difference, put it to use. | |
# irb is great for this. | |
# In irb, instantiate a Lambda and a Proc | |
l = lambda {|x, y| x.times {puts y}} | |
p = Proc.new {|x, y| x.times {puts y}} | |
# See that they are both of the same class |
%fieldset.answer | |
= f.label :title | |
= f.text_field :title | |
= f.label :body | |
= f.text_field :body | |
= f.check_box :_destroy | |
= f.label :_destroy | |
%br |
Try Git | Markdown Cheatsheet | Pro Git | Git Config
Getting Started
In the terminal start by creating a new directory, then run git init
to initialize a git repository
Before object oriented programming, there was what's called 'Procedural Programming'. If I wanted to describe the mundane takss of my day to day routine, I could do so using procedures, such as "I wake up. I brush my teeth, etc."
However, we as humans tend to think of everything as an object. This is why languages like Ruby take objects to the extreme by making everything objects. Object oriented programming is good, because it makes thing easier to understand, and easier to extend. I can just include a library and have access to many more objects and methods.
I get into a car, which is an object. I turn on the car, which is a method on the object. Object interacting with each other is what OOP is all about.
Most modern languages are object oriented. Php, Java, Scala, etc.
Some Differences between a Class and an Object
To get some nice colors in your irb, you can install the gems awesome_print
and interactive_editor
. There should be a dot file (hidden file) in your home directory called .irbrc, if not just create it: sublime ~/.irbrc
.
gem install awesome_print
gem install interactive_editor
sublime ~/.irbrc
Create a static HTML site with 1 or more external CSS stylesheets linked to from a CSS subfolder. Your HTML files should contains all of the items listed below. It should be made up of a minimum of 4 pages. It does not need to be pretty in any way shape or form, but should be functional. You may not use any prefabricated assets or frameworks with the exception of "normalize.css" which is permitted. For images in your page use the placeholder service "http://placehold.it" For text on your page use "Lorem ipsum" text (http://littleipsum.com). For video on the site, use both a .webm video and an .mp4 video. You may use the files located at: http://codecore.ca/video.
<header>
<nav>
<section>