Skip to content

Instantly share code, notes, and snippets.

View iagobelo's full-sized avatar

Iago Belo iagobelo

View GitHub Profile
@iagobelo
iagobelo / Base64EncoderAndDecoder.ts
Last active June 5, 2024 13:39
Base64 encoder and decoder written with types only.
/**
* by @iagobelo
* Decoder in progress!!!
*/
type STRING_TO_CONVERT = "xablau";
type BitResult = Base64EncodeWithoutBa64Chars<STRING_TO_CONVERT>; // 011110-000110-000101-100010-011011-000110-000101-110101
type Result = Base64Encode<STRING_TO_CONVERT>; // eGFibGF1
@iagobelo
iagobelo / FactoryMethod.ts
Last active January 24, 2020 13:11
Factory Method
interface Pizza {
flavor: string;
pieces: number;
cut: () => PizzaSlice | null;
}
interface PizzaSlice { }
class MuzzarellaPizzaSlice implements PizzaSlice { }
### Keybase proof
I hereby claim:
* I am iagobelo on github.
* I am iagobelo (https://keybase.io/iagobelo) on keybase.
* I have a public key ASCLiJAls4HlvcS4_bnpIChaPoc7YQqaM3bS3uLufzsclgo
To claim this, I am signing this object: