Skip to content

Instantly share code, notes, and snippets.

View clcosta's full-sized avatar
:shipit:
Focusing

Claudio Lima clcosta

:shipit:
Focusing
  • Minas Gerais, Brasil
View GitHub Profile
@clcosta
clcosta / .gitconfig
Created May 19, 2025 12:47
.gitconfig
[core]
editor = code --wait
[alias]
s = !git status -s
c = !git add . && git commit -m
amend = !git add . && git commit --amend --no-edit
l = !git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
sw = !git switch
@clcosta
clcosta / .env.example
Last active April 24, 2025 22:50
Docker Composer for configure n8n & evolution-api
// env https://www.youtube.com/watch?v=cQewqCSez5I
SERVER_TYPE=http
SERVER_PORT=8080
SERVER_URL=http://localhost:8080
SENTRY_DSN=
CORS_ORIGIN=*
CORS_METHODS=GET,POST,PUT,DELETE
CORS_CREDENTIALS=true
@clcosta
clcosta / UtilsCli.go
Created March 23, 2024 01:55
Go CLI to utils commands.
package main
import (
"fmt"
"net/url"
"os"
"os/exec"
"strings"
"github.com/spf13/cobra"
@clcosta
clcosta / config-local-git.sh
Created December 6, 2023 18:36
Utils Shell Scripts
#!/bin/bash
if [ $# -ne 1 ]; then
echo "Usage: source git_config.sh <username>"
return 1
fi
case $1 in
"personal")
git config --local user.email PERSONAL@EMAIL.COM
@clcosta
clcosta / timed_lru_cache.py
Created September 11, 2023 20:16
Timed Last Recent Cached Value Decorator
def timed_lru_cache(seconds: int = 60, maxsize: int = 1):
def wrapper_cache(func):
func = lru_cache(maxsize=maxsize)(func)
func.lifetime = timedelta(seconds=seconds)
func.expiration = datetime.utcnow() + func.lifetime
@wraps(func)
def wrapped_func(*args, **kwargs):
if datetime.utcnow() >= func.expiration:
func.cache_clear()
@clcosta
clcosta / semanticGit.py
Created March 16, 2023 21:53
Git Semantic Table
from rich.console import Console
from rich.table import Table
table = Table(title='Semantic GIT')
table.add_column('Command', justify='right', style='cyan', no_wrap=True)
table.add_column('Description', style='magenta')
table.add_row(
'👷 build',
@clcosta
clcosta / python_invest_practice.ipynb
Last active March 7, 2023 11:19
Using python-invest lib in real practice
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@clcosta
clcosta / download.py
Created August 6, 2022 03:18
DownloadAPI - FasAPI
from tempfile import NamedTemporaryFile
from typing import Dict
import requests
from fastapi import FastAPI
from fastapi.responses import FileResponse
from pydantic import BaseModel
class ToDownload(BaseModel):
file: Dict[str, str]
@clcosta
clcosta / network_traffic.py
Created June 30, 2022 20:43
Async_Playwright_Network_Traffic
import asyncio
import json
from playwright.async_api import async_playwright
class NetWork:
def __init__(self, url, **kwargs):
self.network = asyncio.get_event_loop().run_until_complete(
self.watch_network(url, **kwargs)
@clcosta
clcosta / collatz_conjecture.ipynb
Created February 28, 2022 17:35
Collatz Conjucture, uma das formulas mais incríveis que sempre vai te retornar o mesmo resultado pra qualquer número natural, aplicando 2 simples regras.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.