Skip to content

Instantly share code, notes, and snippets.

View felinto-dev's full-sized avatar
Refactor all the things

Émerson Felinto felinto-dev

Refactor all the things
View GitHub Profile
@felinto-dev
felinto-dev / storage.module.ts
Last active June 29, 2024 15:42
After a lot of headaches with plugins that propose to be a wrapper between nestjs and aws-sdk, I decided to configure the dependency injection by myself and the result was not bad. You can use this code as the basis for any cloud storage S3-compatible. I am using @nestjs/config to manage the settings of environment variables. For additional inst…
import { S3 } from 'aws-sdk';
import { Module } from '@nestjs/common';
import { ConfigModule, ConfigService } from '@nestjs/config';
import { scalewayConfig } from '@/app/config/scaleway.config';
import { StorageService } from './services/storage.service';
@Module({
imports: [ConfigModule.forFeature(scalewayConfig)],
providers: [
@felinto-dev
felinto-dev / get-command-args.ts
Created April 15, 2021 07:53
Get commands args from context in Telegram
import { deunionize } from 'telegraf';
import { Context } from '../interfaces';
export const getCommandArgs = (ctx: Context): string => {
const messageText = deunionize(ctx.message).text;
const argsFromCommandRegex = /\/(?:\w+)(?:@\w+?_bot)? (?<args>.*)/i;
const args = argsFromCommandRegex.exec(messageText);
// Get products that does not have item
db.getCollection('gplzone').find({ 'item': { $exists: false } })
// Get products that has notes associated
db.getCollection('gplzone').find({ 'note': { $exists: true } })
// Get products that was not possible to scrape zip content
db.getCollection('gplzone').find({
'item.product_version.is_double_zipped': true
})
@felinto-dev
felinto-dev / api-nests.service.ts
Created August 21, 2022 10:20
Axios Cache Wrapper for NestJS
import { HttpService } from '@nestjs/axios';
import { Injectable } from '@nestjs/common';
import {
setupCache,
buildMemoryStorage,
defaultKeyGenerator,
} from 'axios-cache-interceptor';
@Injectable()
export class ApiService {
@felinto-dev
felinto-dev / README.md
Last active October 14, 2025 04:00
Configuração do gemini-cli-openai com o Docker Compose

Tutorial: Configurando o gemini-cli-openai com Docker

Este guia detalha como configurar e executar a imagem ghcr.io/gewoonjaap/gemini-cli-openai:main usando Docker Compose.

Passo 1: Obtenha a Credencial de Autenticação (GCP_SERVICE_ACCOUNT)

A aplicação precisa de uma credencial OAuth para se autenticar com os serviços do Google. O método mais simples é gerá-la usando o gemini-cli oficial.

  1. Instale o @google/gemini-cli via npm. Abra seu terminal e execute:
@felinto-dev
felinto-dev / index.html
Created October 22, 2025 04:53
Get Hotmart JWT Token
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Get Hotmart JWT</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap" rel="stylesheet">
<style>