Skip to content

Instantly share code, notes, and snippets.

View leandroluk's full-sized avatar
🏠
Working from home

Leandro Santiago Gomes leandroluk

🏠
Working from home
View GitHub Profile
@leandroluk
leandroluk / extend-all.mixin.ts
Last active May 14, 2026 16:41
A mixin to extend multiple classes while maintaining typing.
/* eslint-disable @typescript-eslint/no-explicit-any */
/**
* Utility type to convert a union of types into an intersection of types.
* Ex: UnionToIntersection<{a: 1} | {b: 2}> = {a: 1, b: 2}
*/
type UnionToIntersection<U> = (U extends any ? (x: U) => void : never) extends (x: infer I) => void ? I : never;
/**
* Generic type to represent a constructor class.
@leandroluk
leandroluk / extensions.json
Created August 13, 2025 16:13
.vscode/extensions.json
{
"recommendations": [
// A Vite-native testing framework. It's fast!
"vitest.explorer",
// Icons for Visual Studio Code
"vscode-icons-team.vscode-icons",
// Integrates ESLint JavaScript into VS Code.
"dbaeumer.vscode-eslint",
// Supercharge Git within VS Code — Visualize code authorship at a glance via Git blame annotations and CodeLens,
// seamlessly navigate and explore Git repositories, gain valuable insights via rich visualizations and powerful

How to start a new backend Python project

  1. Commit chore: configuring vscode
    • create file .gitignore:
      # Extra folders
      .tmp
      
      # Distribution / packaging
      .Python
      

How to start a new backend NodeJS + Typecript project

  1. Commit chore: configuring vscode

    • create an repository on the git.

    • create file .gitignore:

      node_modules
@leandroluk
leandroluk / neo4j - docker-compose.yml
Last active June 26, 2025 16:42
Docker Compose with Neo4j container and APOC plugins installed
version: '3'
services:
neo4j:
container_name: neo4j
image: neo4j
ports:
- 7473:7473
- 7474:7474
- 7687:7687
@leandroluk
leandroluk / globo_bot.py
Last active March 30, 2022 17:09
Crawler for extract highlighted notice title of globo.com using requests and BeautifulSoup4
import requests
from bs4 import BeautifulSoup
class GloboBot:
def fetch_first_page(self) -> str:
resp = requests.get("https://www.globo.com/", headers={
"User-agent": (
"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHT"
"ML, like Gecko) Chrome/90.0.4430.212 Safari/537.36"
)