Skip to content

Instantly share code, notes, and snippets.

View dev-mauricioAB's full-sized avatar
🏠
Working from home

Maurício Alexandre Barroso dev-mauricioAB

🏠
Working from home
  • Radix Eng
  • Florianópolis, SC
View GitHub Profile
@dev-mauricioAB
dev-mauricioAB / dp_iterator.ts
Created October 30, 2025 09:40
Iterator Pattern in Software Development
// Iterator interface
interface Iterator<T> {
next(): T | null;
hasNext(): boolean;
}
// Aggregate interface
interface IterableCollection<T> {
createIterator(): Iterator<T>;
}
@dev-mauricioAB
dev-mauricioAB / dp_decorator.ts
Created October 27, 2025 22:00
Design Patterns - Decorator Pattern
// Component interface
interface Coffee {
cost(): number;
description(): string;
}
// Concrete component
class SimpleCoffee implements Coffee {
cost(): number {
return 5;
@dev-mauricioAB
dev-mauricioAB / gist:24de23f05056de774583d687442a8430
Last active December 6, 2021 23:12
medium_routes_article_01
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { FirstComponent } from './components/first/first.component';
import { SecondComponent } from './components/second/second.component';
@NgModule({