Skip to content

Instantly share code, notes, and snippets.

View arthurfiorette's full-sized avatar

Arthur Fiorette arthurfiorette

View GitHub Profile
@arthurfiorette
arthurfiorette / README.md
Last active January 10, 2026 23:26
JSCodeshift transform to convert namespace imports to named imports

Namespace Import Transformer

A JSCodeshift transform that converts namespace imports (import * as) to named imports for better tree-shaking and bundle size optimization.

Overview

This transformer uses a two-phase approach to handle complex codebases with multiple namespace imports and cross-references:

  1. Phase 1: Collects all transformation data for all namespaces before any AST modifications
  2. Phase 2: Applies all transformations based on the collected data
@arthurfiorette
arthurfiorette / index.js
Last active January 4, 2026 21:29
`format-package-json` test extractor.
#!/usr/bin/env node
/**
* Extract Test Data from AVA Snapshot Markdown Files
*
* This script reads AVA's human-readable snapshot markdown files (.js.md) and
* extracts test cases with their input/output data as clean JSON objects.
*
* AVA generates two snapshot formats:
* 1. Binary .snap files (CBOR encoded, not human-readable)
@arthurfiorette
arthurfiorette / settings.json
Created November 20, 2023 14:45
Windows Terminal settings
{
"$help": "https://aka.ms/terminal-documentation",
"$schema": "https://aka.ms/terminal-profiles-schema",
"actions":
[
{
"command":
{
"action": "moveFocus",
"direction": "down"
@arthurfiorette
arthurfiorette / hzk2.cfg
Last active November 1, 2025 00:21
Counter Strike 2 Config
//
/// Hazork CFG - Last Edit 28/09/2023
//
//
/// Binds
bind c "slot5;drop";
bind h noclip;
bind q +HzkSwitch;
@arthurfiorette
arthurfiorette / UF.java
Last active October 19, 2025 13:38
Todas as UF do Brasil em um único enum + suporte extras.
import com.fasterxml.jackson.annotation.JsonCreator;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.experimental.Accessors;
/**
* Enum com todas as Unidades da Federação do Brasil. Contém o nome da Unidade,
* a sigla e a capital da Unidade da Federação. As unidades estão listadas por
* ordem alfabética no enum.
*
@arthurfiorette
arthurfiorette / settings.json
Last active January 4, 2022 22:00
Windows Terminal Configuration
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"actions": [
{
"command": {
"action": "copy",
"singleLine": false
},
"keys": "ctrl+c"
},
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.