Skip to content

Instantly share code, notes, and snippets.

View cmjunior's full-sized avatar

Celso Marigo Junior cmjunior

  • MEI
View GitHub Profile
@cmjunior
cmjunior / gist:91e4fcfac27328a1da77849b93b515b3
Created July 1, 2023 16:25
Code where I convert the Fortify certificate to the correct format.
var el = document.createElement('peculiar-fortify-certificates');
el.debug = true;
el.filters = {
onlyWithPrivateKey: true
};
el.addEventListener('cancel', function() {
alert('"cancel" callback');
});
@cmjunior
cmjunior / create-user.ts
Created September 12, 2022 14:24
- Cloud Function para criar um usuário no Google Firebase Authentication
import * as admin from 'firebase-admin';
import * as functions from "firebase-functions";
admin.initializeApp();
exports.createUser = functions.https.onRequest( (req, res) => {
let { email, password } = req.body
if ( !(email || password) ) {
res.status(500).json({
@cmjunior
cmjunior / only-number.directive.ts
Created February 8, 2021 13:49
- Diretiva para que campo aceite apenas números;
import { Directive, ElementRef, HostListener } from '@angular/core';
// Source: https://codeburst.io/digit-only-directive-in-angular-3db8a94d80c3
@Directive({
selector: '[onlyNumber]'
})
export class OnlyNumberDirective {
private navigationKeys = [
'Backspace',
'Delete',
@cmjunior
cmjunior / responsive-stepper.component.ts
Created July 8, 2020 05:36 — forked from davideas/responsive-stepper.component.ts
Angular 8.x Responsive Stepper with headers disable feature
import { Directionality } from '@angular/cdk/bidi';
import { CdkStep, CdkStepper, StepperSelectionEvent } from '@angular/cdk/stepper';
import {
AfterViewChecked,
AfterViewInit,
ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
ContentChildren,
ElementRef,