Skip to content

Instantly share code, notes, and snippets.

@r1ckhenry
r1ckhenry / loops.rb
Created April 5, 2017 14:37
Loops, filtering and summing - Ruby
####### FILTERING EXAMPLE ( FUNCTION )
heroes = [
{ "type" => "elf", "name" => "legolas" },
{ "type" => "human", "name" => "aragon" },
{ "type" => "human", "name" => "boromir" },
{ "type" => "wizard", "name" => "gandalf" }
]
def filter_by_type( heroes_array, type )
@r1ckhenry
r1ckhenry / bears_river_fish.md
Created January 17, 2017 14:50
Bears, River, Fish

Bears, River, Fish

We are going to build a small ecosystem! We want to create an ecosystem made up of 3 parts: bears, river and fish. You will need a class for each of these. From this you can make instances and build your ecosystem.

How our ecosystem works

  • A river should have a name e.g. "Amazon"
  • A river should hold many fish
  • A fish should have a name
@r1ckhenry
r1ckhenry / karaoke.md
Created December 2, 2016 10:15
Karaoke

The OO CodeClan Caraoke (CCC)

You have been approached to build software for a Karaoke bar. Specifically, they want you to build a software for checking guests in and out, plus handling songs.

Your program should be test driven and should be able to:

  • Create rooms, songs and guests
  • Check in guests to rooms/Check out guests from rooms
  • Add songs to rooms
@r1ckhenry
r1ckhenry / music_lib.md
Created August 10, 2016 13:05
Music Library Lab

Music Library Lab - Sinatra App

Last week we created a Music app with albums and artists. Create a RESTFul Sinatra app on top of the existing code we created. There should be:

Create routes for albums and artists:

  • Index
  • New
  • Create
@r1ckhenry
r1ckhenry / sinatra_hw.md
Created August 8, 2016 13:53
sinatra_hw

Sinatra Homework

Create a sinatra app which has the follwing routes:

  1. '/' - responds HTML with information about you e.g. name & bio
  2. Part A:

'/address' responds with this address in JSON: { address: '3 ARGYLE HOUSE',

@r1ckhenry
r1ckhenry / dodgeball.md
Created August 5, 2016 08:16
Dodgeball League

Dodgeball League

Create a Dodgeball league. Your models could include:

  • team
  • match

A team should at least have a:

  • ID
@r1ckhenry
r1ckhenry / pet_store.md
Created August 3, 2016 14:00
PET STORE

Pet Store

You have been asked to create an app that will allow the owner of a Pet Store chain manage their stores and stock(pets).

They would like to be able to:

  • Create and Save Pet Stores

  • Create and Save Pets

  • List all the pets of a store

@r1ckhenry
r1ckhenry / farm_manager.md
Created July 26, 2016 14:36
Farm Manager

Farm Manager

  1. Add UPDATE action to server.js:
    • add route to handle update of existing document
  2. Add DELETE action to server.js
    • add route to handle deletion of existing document

Use Insomnia to test.

Extension ( not required ):

@r1ckhenry
r1ckhenry / ajax_countries.md
Created July 19, 2016 12:23
AJAX Countries

#Rest Country API Lab/Homework

  • Make a select drop down with all the countries,
  • Display the country name, population, capital city of the country that is selected.
  • Persist the last country that was selected
  • Style

Further: Add new functionality. eg

  • Show bordering countries and their statistics.
  • Filter select to only show countries in a region, sub-region.

#DOM manipulation, callback lab.

##Quotes App

The quotes are all hardcoded in our web page. Let's start moving towards having a dynamic web application and set the existing quotes programatically via JavaScript.

  • Create an array of the existing quotes, each quote having text and author
  • Add the quotes to the page dynamically with JavaScript

Further: