Skip to content

Instantly share code, notes, and snippets.

Avatar

Mary Rose Cook maryrosecook

View GitHub Profile
View exercise2.rb
# Use test-driven development to write a method that:
# * Takes an array of numbers.
# * Returns the sum of the numbers in the array.
# * e.g.
# * Input: [1, 2, 3, 4, 5]
# * Return: 15
# * Make sure to create a separate project directory for your code.
View exercise1.rb
# Use test-driven development to write a method that:
# * Takes an array of numbers.
# * Returns an array of the same numbers, except each number has had 1 added to it.
# * e.g.
# * Input: [1, 2, 3, 4, 5]
# * Return: [2, 3, 4, 5, 6]
# * Make sure to create a separate project directory for your code.
View gist:8e912a99b4c6cccf5455d935cb970fc7
OVERVIEW OF THE WEEK
- Encapsulating Single Responsibilities (rather than just common behaviour) into classes
- makes code easy to reuse
- makes code easy to change
- makes code easy to understand
- Refactoring code for SRP
- Adopt this code writing process
View Smiley Face.carbide.md
View responding-to-a-students-request-for-help.md

Responding to a student's request for help

Process

  1. Map the student's request for help to one of the underlying problems listed below.

  2. Apply one of the suggested solutions.

  3. Ask the student for feedback on your help.

@maryrosecook
maryrosecook / ...
Last active Sep 13, 2018
Reminders to myself to help me get better at programming. I don't always manage to do these things, but I try. Please feel free to add your own reminders to yourself in the comments below!
We couldn’t find that file to show.
View lauren4.py
to_dos = {"Haircut": False}
def print_to_dos(to_dos):
for to_do in to_dos:
if to_dos[to_do] == False:
print("- %s" % to_do)
else:
print("x %s" % to_do)
def new_to_do(to_dos):
to_do = raw_input("What else do you need to do? ")
View gist:88e414a6599cabd32224
(require 'package)
(add-to-list 'package-archives
'("marmalade" .
"http://marmalade-repo.org/packages/"))
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t)
(package-initialize)
;; load paths
(add-to-list 'load-path "~/.emacs.d/src/")
View lauren3.py
to_dos = ["Haircut"]
def print_to_dos(to_dos):
for to_do in to_dos:
print("- %s" % to_do)
def new_to_do(to_dos):
to_do = raw_input("What else do you need to do? ")
to_dos.append(to_do)
View fp_exercise5.py
bands = [{'name': 'sunset rubdown', 'country': 'UK', 'active': False},
{'name': 'women', 'country': 'Germany', 'active': False},
{'name': 'a silver mt. zion', 'country': 'Spain', 'active': True}]
def assoc(_d, key, value):
from copy import deepcopy
d = deepcopy(_d)
d[key] = value
return d