Skip to content

Instantly share code, notes, and snippets.

View H4ad's full-sized avatar

Vinicius Lourenço H4ad

View GitHub Profile
@H4ad
H4ad / ids-benchmark.ts
Created January 8, 2023 00:46
NestJS UUID to UID
// to run this file, install: npm i --save benchmark uuid uid nanoid@3.x
// and then just run with: npx ts-node ids-benchmark.ts
import * as Benchmark from 'benchmark';
import { uid } from 'uid';
import * as uuid from 'uuid';
import * as nanoid from 'nanoid';
const suite = new Benchmark.Suite();
@H4ad
H4ad / benchmark.ts
Created January 7, 2023 15:09
NestJS Logger Benchmarks
// to run this file, copy this file inside an NestJS API
// then install: npm i --save benchmark
// then copy `better-logger.service.ts` and `better-console-logger.service.ts`.
// and then just run with: npx ts-node src/benchmark.ts
const Benchmark = require('benchmark');
import { Logger } from '@nestjs/common';
import { BetterLogger } from './better-logger.service';
@H4ad
H4ad / benchmark.ts
Last active February 2, 2023 23:02
MetadataScanner Benchmark
var Benchmark = require('benchmark');
import {
isConstructor,
isFunction,
} from '@nestjs/common/utils/shared.utils';
import { MetadataScanner } from '@nestjs/core';
import { Injectable } from '@nestjs/common/interfaces/injectable.interface';
var suite = new Benchmark.Suite();
@H4ad
H4ad / 00_RELEASE.md
Last active September 9, 2022 11:48
Autotag com Changelog

Autotag com Changelog

Para começar, você deve instalar as bibliotecas:

npm i --save-dev --save-exact auto-changelog @jsdevtools/version-bump-prompt @jsdevtools/ez-spawn capacitor-set-version cross-env

Dentro do package.json, você precisa criar o script chamado release, da seguinte forma:

@H4ad
H4ad / Sub - Inteligência Computacional.ipynb
Last active June 24, 2021 01:18
Sub - Inteligencia Computacional
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@H4ad
H4ad / s3-upload-iam-policy.json
Created January 14, 2021 18:45
S3 Upload IAM Policy - Minimal Permissions to Upload File with Presigned Post URL
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:AbortMultipartUpload",
"s3:PutObjectLegalHold"
@H4ad
H4ad / .README.md
Created August 24, 2020 02:37
NestJS Configurations

NestJS Configurations

This is my configurations for startup of NestJS Applications.

@H4ad
H4ad / .0.README.md
Last active April 15, 2024 08:56
Typeorm Configuration for NestJS

Typeorm Configurations

This is my configurations for Typeorm using NestJS.

File Structure

Follow the file structure above to use this configuration.

ormconfig.js
@H4ad
H4ad / README.md
Last active August 5, 2020 19:05 — forked from ValentinFunk/README.md
Fixes SVG Gradients for Safari by changing fill URLs to the current pathname. Also fixes xlink:href URLs.

Snippet to fix SVG issues in Angular (2+) with Safari, Firefox and Chrome

This listens to Angular route changes and on route change does the following:

  1. Replaces the link in <use xlink:href="#some-id"></use> by a path prefixed version
  2. Replaces the fill property in referenced SVGs by a path prefixed version
  3. Replaces the style in <svg style="fill: url(#gradient)"> with a prefixed version

Adapted from Gist by Leon Derijke

@H4ad
H4ad / cloudSettings
Last active November 24, 2019 21:10
As minhas configurações do VSCode
{"lastUpload":"2019-11-24T21:10:53.873Z","extensionVersion":"v3.4.3"}