Skip to content

Instantly share code, notes, and snippets.

View keithdhd's full-sized avatar

Keith Douglas keithdhd

View GitHub Profile
@keithdhd
keithdhd / rock_paper_scissors_instructor.md
Last active February 26, 2023 14:05
Rock, paper, scissors (Instructor notes)

Rock, paper, scissors

Instructor Notes

Learning Objectives

  • Learn how to decompose a problem
  • Practice logical reasoning
  • Know how to work with lists
  • Know how to use functions
  • Know how to get user input for a program
@keithdhd
keithdhd / hello_world.md
Last active November 26, 2019 16:42
Hello World
<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">
    <title>Hello World!</title>
    <style media="screen">
      body{
 background-color: #1B3445;
@keithdhd
keithdhd / rails_api_homework.md
Last active September 12, 2016 12:06
Rails API Homework

#Rails API Homework

Create a Rails app called shows_api. Your API should return and repond to JSON (i.e. no HTML views required)

The INDEX route should be localhost:3000/api/shows

It's going to have a resource called Shows to manage TV shows and films.

You only have to implement an INDEX and CREATE in the ShowsController (i.e not all the RESTful routes)

  • Create a planet_spec.js file for testing
  • Create a Planet constructor that takes a name as an argument and make it available to the test file with module.exports
  • Write a test that creates a new Planet and checks the Planet has the right name
  • Create a SolarSystem constructor that takes in a name and has an initial empty array of planets.
  • Export the SolarSystem constructor to make it available to other files
  • Test that the SolarSystem has an intial empty array of planets.
  • Add a method to the SolarSystem constructor that adds a planet to the array
  • Write a test that instantiates a new SolarSystem, some Planets, adds the planets to the SolarSystem and tests the SolarSystem planets array is correct