Skip to content

Instantly share code, notes, and snippets.

View qubitz's full-sized avatar

Tyler Goffinet qubitz

View GitHub Profile
using System;
using System.Collections.Generic;
var data1 = new Data("data1");
var data2 = new Data("data2");
Console.WriteLine(new DataEqualityComparer().Equals(data1, data2));
public record Data(string SomeProp);
public class DataEqualityComparer : IEqualityComparer<Data>
@qubitz
qubitz / Time_OOP.py
Created March 24, 2017 02:45
Clean code practice with Python!
class Time:
"""Represents and manipulates hours and minutes"""
def __init__(self, hour=12, minute=0):
valid_hour, valid_minute = Time.make_valid(hour, minute)
self.__hour = valid_hour
self.__minute = valid_minute
def __str__(self):
return "{0}:{1:02}".format(self.__hour, self.__minute)