Skip to content

Instantly share code, notes, and snippets.

View sarahboufelja's full-sized avatar
💭
I may be slow to respond.

Sarah Boufelja sarahboufelja

💭
I may be slow to respond.
View GitHub Profile
@sarahboufelja
sarahboufelja / 1.srp.py
Created March 31, 2022 10:14 — forked from dmmeteo/1.srp.py
SOLID Principles explained in Python with examples.
"""
Single Responsibility Principle
“…You had one job” — Loki to Skurge in Thor: Ragnarok
A class should have only one job.
If a class has more than one responsibility, it becomes coupled.
A change to one responsibility results to modification of the other responsibility.
"""
class Animal:
def __init__(self, name: str):
# Credit for this: Nicholas Swift
# as found at https://medium.com/@nicholas.w.swift/easy-a-star-pathfinding-7e6689c7f7b2
from warnings import warn
import heapq
class Node:
"""
A node class for A* Pathfinding
"""
@sarahboufelja
sarahboufelja / .block
Created August 7, 2016 14:25 — forked from mbostock/.block
Bar Chart I
license: gpl-3.0
---
title: "Codebook template"
author: "Your name here"
date: "The date here"
output:
html_document:
keep_md: yes
---
## Project Description