Skip to content

Instantly share code, notes, and snippets.

View rob0t7's full-sized avatar
🍻
Coding

Robert Jackiewicz rob0t7

🍻
Coding
  • Toronto
View GitHub Profile

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
@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
@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 / 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

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.

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
@rob0t7
rob0t7 / old_way.rb
Created January 12, 2016 22:15
Moving from Procedural to OOP Programming
# Brewery related Functions
def create_beer(brewery, name, style, abv)
beer = {name: name, style: style, abv: abv, quantity: 0}
brewery[:beers] << beer
end
def print_brewery(brewery)
puts "\n"
puts "#{brewery[:name]}"
var API_KEY = "MDphMmIxNDY0Mi0zYjYwLTExZTUtYTRlOS1hZjBkOWE1YzRmYzI6WWRZR1h6Q0ZwQk9JNG00YTJMcHBsOFNxcUxjeklpTmVEWGlz";
var beerTemplate = _.template($('#beer-template').html());
function getBeerList(name) {
$.ajax({
url: 'https://lcboapi.com/products',
data: {q: name},
method: 'GET',
headers: { 'Authorization': "TOKEN " + API_KEY }
<div id="container">
<img src="http://i.imgur.com/ls5qG.jpg">
</div>
@rob0t7
rob0t7 / index.html
Last active June 30, 2016 14:57
CSS Game
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.3/normalize.css">
<link rel="stylesheet" href="main.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="main.js"></script>
</head>