Skip to content

Instantly share code, notes, and snippets.

View rapala61's full-sized avatar
🏠
Working from home

Rafael rapala61

🏠
Working from home
View GitHub Profile
@rapala61
rapala61 / map2.html
Created September 14, 2015 14:22
maps2
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Maps</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/skeleton/2.0.4/skeleton.css" charset="utf-8">
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.js"></script>
<script type="text/javascript" src="countries.js"></script>
<style media="screen">
#map {
@rapala61
rapala61 / maps2b.html
Created September 14, 2015 14:51
maps2b
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Maps</title>
<style type="text/css">
/* The map has to have a height before it is 'drawn' */
#countries-list {
height: 500px;
@rapala61
rapala61 / maps3.html
Created September 14, 2015 15:10
maps3
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Maps</title>
<style type="text/css">
/* The map has to have a height before it is 'drawn' */
#countries-list {
height: 500px;
@rapala61
rapala61 / Kitten.rb
Created November 30, 2015 20:22
Kitten Class
class Kitten
@@lives = 9
# serves the purpose of setting up the object
def initialize( name, color, owner )
@name = name
@color = color
@owner = owner
end
@rapala61
rapala61 / Migrations101Lab_A.md
Last active April 10, 2016 01:12
Generate Migrations.

Migrations Tasks Lab (35m)

Description

You are tasked with creating a table in your freshly created reservations database. This table will hold plane tickets detail information.

Be mindful of the data types you will choose for your table columns. Being told you don't have enough fuel to reach your destination mid flight is no joke!

Remember that to create an Active Record migration, you need to use Rake and its tasks: Example:

@rapala61
rapala61 / ActiveRecordAssociationsLab.md
Last active December 10, 2015 20:53
The student will practice generating AR models with associations.

Relationships Models Lab (60m)

We know how to create an MVC app, and we've discovered ActiveRecord, which allow us to manipulate records and associations in the database really easily. For the next lab session, we're going to build a Cookbook app:

By the end you should be able to create records and associations in the Rails console bin/rails c. Generate and run the migrations and create the models with all the associations so that it is possible to link the models in the console.

Remember that you can specify references when creating models, this way the migration also generates foreign keys which are needed to build the relationships between tables.

 # This command assumes there is a manufacturers table
@rapala61
rapala61 / RSpecLab.md
Last active December 14, 2015 20:53
RSpec Lab, based on already existing project seen in class. Modify accordingly if the project is to be also created as part of the Lab.

BDD with RSpec Lab (50m)

We are now going to continue building features for our employer HonestBank! 😉

We are going to use the TDD methodology. This means:

  1. You are going to write the test BEFORE you implement the feature.
  2. Run the test suite and watch it fail! ✅🔥🔥
  3. Then, you are going to implement the feature in the appropriate model.
  4. Run the test suite AGAIN and watch it succeed! ✅✅✅

Heroku Deployment Lab (45m)

Let's deploy to Heroku!

You will be cloning this repo to your Desktop... I repeat TO YOUR DESKTOP!

Follow the following steps to get the labs repo in your desktop:

  1. Navigate to your desktop. In your terminal type cd ~/Desktop
@rapala61
rapala61 / MongooseModelExercise.md
Last active January 5, 2016 22:11
Mongoose Model Exercise

Description

We are going to create a mongoose model and use it!

  1. Create a project folder named cardealer and navigate to it.

  2. Run npm init

  3. Run npm install --save mongoose

@rapala61
rapala61 / MongoMongooseLab.md
Last active January 4, 2016 17:35
Mongo Mongoose Lab

Mongoose Modeling – Embedded Documents - (60m)

Introduction

Work with your partner next to you. Use one laptop. The driver switches every 15m.

To practice using Mongoose, we will design a small data persisting application to keep track of airport data with different models: Airport, Terminal, Flight, and Passenger. You will have to write the models and then hard code data in your app.js file according to the requirements below. Since we're not worried about Express or views in this activity, log the results of your data persistence in the console when the file is executed - with node app.js - so we know what's being saved.

Exercise