Skip to content

Instantly share code, notes, and snippets.

View pauloantonelli's full-sized avatar

Paulo Antonelli pauloantonelli

View GitHub Profile
@pauloantonelli
pauloantonelli / comandos npm
Last active October 22, 2018 21:02
Comandos NPM basicos do dia a dia
Como ver quais pacotes estão instalados globalmente na sua máquina e quais suas versões.
npm list -g --depth=0
Como deletar o pacote desejado globalmente da maquina
npm uninstall -g nomeDoPacote
Como ver se tem algum pacote ou arquivo especifico npm com problema
npm audit
Concertar automaticamente os pacotes ou arquivos do npm com problema
@pauloantonelli
pauloantonelli / comandos git
Created October 25, 2018 23:02
comandos git
Comandos
git config --global user.name "wesllyakatsuka"
//Configura o seu nome de usuário (Tem que ser o mesmo cadastrado no memomento da conta)
git config --global user.email wesllyakatsuka@gmail.com
//Configura o seu nome de usuário (Tem que ser o mesmo cadastrado no memomento da conta)
git status
//Exibe tudos os arquivos dentro de uma pasta e aponta se estão ou não sendo rastreados
@pauloantonelli
pauloantonelli / .vscode|settings.json
Last active April 12, 2021 17:44
Visual Studio Code Settings Sync Gist
{
}
@pauloantonelli
pauloantonelli / dddsBrasileiros.json
Created December 17, 2018 20:59 — forked from ThadeuLuz/dddsBrasileiros.json
Objeto JSON com Estados Brasileiros por DDD e lista de DDDs por Estados.
{
"estadoPorDdd": {
"11": "SP",
"12": "SP",
"13": "SP",
"14": "SP",
"15": "SP",
"16": "SP",
"17": "SP",
"18": "SP",
@pauloantonelli
pauloantonelli / infinite-scroll.directive.ts
Created June 19, 2020 00:08 — forked from gangadharjannu/infinite-scroll.directive.ts
This is an Angular 2 infinite scroll directive. It is simple, easy to use and very CPU-efficient.
// USAGE:
//
// When you attach the infiniteScroll directive to an element, it will emit the infiniteScrollAction
// @Output() event every time the user has scrolled to the bottom of the element. Your loadMoreArticles
// function can make an HTTP call and append the results to the articles list, for example. In doing this,
// you effectively increase the height of the element and thus begin the process of the infiniteScroll directive
// again, over and over until the element height stops increasing.
//
// <div class="container" infiniteScroll (infiniteScrollAction)="loadMoreArticles()">
// <div class="article" *ngFor="let article of articles">
@pauloantonelli
pauloantonelli / onesingal.service.ts
Created September 29, 2020 01:12 — forked from PsyGik/onesingal.service.ts
OneSignal Angular TypeScript
import {Injectable} from '@angular/core';
import {Cache} from '../utils/storage.provider'; // Decorator to access local storage
let OneSignal;
const url = '';
@Injectable()
export class OneSignalService {
@Cache({pool: 'OneSignal'}) oneSignalInit; // to check if OneSignal is already initialized.
@pauloantonelli
pauloantonelli / either.dart
Last active February 26, 2023 03:59
dart Either
abstract class IGlobalFailure implements Exception {
final String? message;
IGlobalFailure({this.message});
}
abstract class EitherFailure implements Exception {
final String? message;
EitherFailure({this.message});
}
@pauloantonelli
pauloantonelli / validators
Created February 12, 2022 12:21
Usefull validators for dart
class Validators {
static bool validateEmail(String value) {
if (value.isEmpty) return false;
final String pattern =
r'^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$';
final regex = RegExp(pattern);
final result = regex.hasMatch(value);
return result;
}
@pauloantonelli
pauloantonelli / usefull-tool-for-macOs.md
Last active December 13, 2023 12:46
usefull tool for macOs
@pauloantonelli
pauloantonelli / dart-clean-arch-vscode-snippets.json
Created February 23, 2022 14:46
dart clean arch layers vscode snippets
{
// Domain
// Repository
"Dart Clean Arch - Repository Interface Type: Set": {
"prefix": ["repository-interface-set"],
"body": [
"abstract class I${1:RuleName}Repository {\t$0",
" Future<Either<${1:RuleName}RepositoryError, ${2:T}>> call(${3:T} param);",
"}\t$0"
],