Skip to content

Instantly share code, notes, and snippets.

View rob0t7's full-sized avatar
🍻
Coding

Robert Jackiewicz rob0t7

🍻
Coding
  • Toronto
View GitHub Profile
def fizzbuzz(start, final)
start.upto(final) do |i|
puts fizzbrain(i)
end
end
def fizzbrain(num)
output = ''
output << 'Fizz' if num % 3 == 0
output << 'Buzz' if num % 5 == 0

Rails and Form Helpers

The agenda for today is as follows:

  1. Create forms using form_tag.
  2. Create forms that bind to a rails ActiveModel class
  3. Create a form that contains a nested form bound to an ActiveModel object

All the examples will be done in class as a live lecture.

@rob0t7
rob0t7 / closures.md
Last active November 4, 2015 04:44
Javascript Closures

Javascript Closures, IIFE

Today we are going to look at some interesting features of the javascript language. Javascript is a prototype-based language with 1st class functions derived from scheme (and self) languages with a C like syntax.

What is a prototype-based language? It is a language of object-oriented programming in which behaviour (think inheritance) is performed by cloning existing objects (i.e. prototypes). It is also an

@rob0t7
rob0t7 / cat.rb
Last active October 28, 2015 15:15
OOP Review, RSpec Review and Modules
require_relative 'jsonable'
require 'pry-byebug'
class Party
def self.throw_party(number_of_candles)
'We are partying'
true
end
end
@rob0t7
rob0t7 / rails.textile
Created October 11, 2015 02:42
Ruby on Rails coding best practices

Ruby on Rails coding standard

{{toc}}

Code style

  • Use UTF-8. It’s 21 century, 8bit encodings dead now.
  • Use 2 space indent, not tabs
  • Use Unix-style line endings
  • Keep lines not longer than 80 chars

Final Projects

It time to start our final project. Before we do, let's go over a few things shall we....

Before you start you will need to supply the following to John and myself via email:

  1. Team Members
  2. Project Description