Skip to content

Instantly share code, notes, and snippets.

View fbidu's full-sized avatar

Felipe Rodrigues fbidu

View GitHub Profile
@fbidu
fbidu / primes.py
Created November 24, 2019 14:20
A simple iterator that generates all the prime numbers
"""
primes provide a very simple iterator that's able
to generate all the prime numbers!
This is for teaching purposes only.
"""
class Primes:
"""
"""
Data are bits
Numbers can be written as bits
Therefore, any data can be written as a number
Here is a small playground
"""
def text_to_int(filename):
@fbidu
fbidu / read_only_wrapper.py
Created February 22, 2023 10:57
simple snippet for a read-only wrapper around a base class
class User:
"""
User class
It has some methods and properties to simulate the functions
of a regular class.
"""
def __init__(self, first_name, last_name, email, password):
self.first_name = first_name
self.last_name = last_name