Skip to content

Instantly share code, notes, and snippets.

View Andrielson's full-sized avatar
🏠
Working from home

Andrielson Ferreira da Silva Andrielson

🏠
Working from home
View GitHub Profile
@Andrielson
Andrielson / generic-observable-state.ts
Last active December 18, 2021 00:14
A generic observable state implementing a interface that is compatible with BehaviorSubject from RxJS.
import {
Inject,
Injectable,
InjectionToken,
ValueProvider,
} from "@angular/core";
import { BehaviorSubject, fromEvent, Observable, Subject } from "rxjs";
import { map, takeUntil } from "rxjs/operators";
const MENU_STATE_ID = "UNIQUE_MENU_STATE_ID";
@Andrielson
Andrielson / tetrasexagesimal.php
Created September 2, 2020 15:15
PHP base64int
<?php
define('ALFABETO', 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/');
function tetrasexagesimal(int $numero): string {
$retorno = "";
while ($numero >= 0) {
if ($numero === 0) {
$retorno = "A{$retorno}";
break;