Skip to content

Instantly share code, notes, and snippets.

View michalpulpan's full-sized avatar

Michal Půlpán michalpulpan

View GitHub Profile
@michalpulpan
michalpulpan / next-intl-parser.ts
Last active December 5, 2025 23:34
Simple (and a bit naive) parser generating i18n JSON files for namespaces and translation keys found in `.ts` and `.tsx` files within the project utilizing `next-intl`.
import * as fs from "fs";
import * as path from "path";
import { glob } from "glob";
import * as parser from "@babel/parser";
import * as t from "@babel/types";
import traverse from "@babel/traverse";
// Types for translation extraction
type Translations = Record<string, string>;
type NamespaceTranslations = Record<string, string[]>;
@michalpulpan
michalpulpan / books_aerospike_generator.py
Created May 6, 2023 13:30
Generate Books, Reviews, Loans and Users into Aerospike db
import random
import string
import datetime
import aerospike
from aerospike import exception as ex
config = {"hosts": [("127.0.0.1", 3000)]}