Skip to content

Instantly share code, notes, and snippets.

@fabiolimace
fabiolimace / gnucash-caixa-visa-expandir-parcelas.awk
Created December 28, 2024 14:30
Expandir parcelas de cartão de crédito da CAIXA para importação no GnuCash
#!/usr/bin/mawk -f
#
# Processa entradas de extrato de cartão de crédito da CAIXA neste formato:
#
# 05/11 AMAZON MARKETPL BR 03 05 52,50
#
# Transforma cada entrada processada em uma lista de entradas assim:
#
# 05/11 05/11 - AMAZON MARKETPL - 5 x 52,50 262,50
@fabiolimace
fabiolimace / hash-uniqueness.sh
Last active December 21, 2024 14:53
Hash Function Uniqueness and Collision
#!/bin/bash
# Calculates hash uniqueness.
#
# Usage:
#
# hash-uniqueness.sh PROGRAM LENGTH WINDOW
#
# hash-uniqueness.sh md5sum
#
@fabiolimace
fabiolimace / NonCryptoHash.java
Last active December 21, 2024 06:39
Non-Cryptographic Hash Functions: CRC32, FNV-1A and MIX of both.
package com.example;
import java.nio.charset.StandardCharsets;
// https://www.youtube.com/watch?v=siV5pr44FAI
public final class NonCryptoHash {
// http://www.mrob.com/pub/comp/crc-all.html (crc32-adler)
private static final int[] crc32tab = { //
0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, //
@fabiolimace
fabiolimace / SHA-256 UUIDv8 and Tag URI.md
Last active December 23, 2024 23:02
SHA-256 UUIDv8 and Tag URI

SHA-256 UUIDv8 and Tag URI

SHA-256 UUIDv8

UUIDv8 is a UUID type defined by RFC 9562 that allows for customization.

Our custom UUIDs are generated by UUIDv8.generate() using SHA-256 hash algorithm.

@fabiolimace
fabiolimace / TSID.diff
Created November 20, 2024 16:05
TSID.diff
diff --git a/src/main/java/io/hypersistence/tsid/TSID.java b/src/main/java/io/hypersistence/tsid/TSID.java
index 1ca20ca..665f081 100644
--- a/src/main/java/io/hypersistence/tsid/TSID.java
+++ b/src/main/java/io/hypersistence/tsid/TSID.java
@@ -36,6 +36,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.locks.ReentrantLock;
import java.util.function.IntFunction;
import java.util.function.IntSupplier;
+import java.util.function.Supplier;
@fabiolimace
fabiolimace / DELAS_PBv2.md
Last active October 19, 2024 14:31
Brazilian Portuguese simple words from DELAS_PBv2 - USP/NILC/Unitex-PB

DELAS-PB

O DELAS_PBv2 é um dicionário de Palavras Simples para o Português Brasileiro. Possui aproximadamente 67.500 canônicas associadas a suas regras de flexão. Foi atualizado em 07/05/2015.

URL: http://www.nilc.icmc.usp.br/nilc/projects/unitex-pb/web/dicionarios.html

Projeto Unitex-PB

O projeto Unitex-PB: a construção de recursos lingüístico-computacionais para o português do Brasil.

@fabiolimace
fabiolimace / portuguese
Created October 19, 2024 14:14
Portuguese words from `/usr/dict/words` (apt install wportuguese)
This file has been truncated, but you can view the full file.
a
à
AAC
Aachen
Aalborg
Aarhus
aba
abas
abacate
@fabiolimace
fabiolimace / brazilian
Created October 19, 2024 14:12
Brazilian words from `/usr/dict/words` (apt install wbrazilian)
Aarão
Abade
Abadia
Abadiânia
Abaetetuba
Abaeté
Abaiara
Abaixo
Abaré
Abatiá
@fabiolimace
fabiolimace / README.md
Last active October 19, 2024 16:00
Scripts to find dead rules in `espeak-ng`'s `pt_rules`

Scripts to find dead rules in espeak-ng's pt_rules

These scripts in this file can be used to find dead rules in espeak-ng's pt_rules, the rules file for Portuguese language.

Get the lists of words

First you need lists of words:

  • DELAS PB v2 (simple words) from Unitex-PB project;
  • DELAF PB v2 (simple words with Inflection) from Unitex-PB project;
@fabiolimace
fabiolimace / espeak-ng-say-list.sh
Last active October 9, 2024 01:17
espeak-ng-say-list.sh: A scritp that says a list of words, until you answer good or not for each one of them.
#!/bin/bash
#
# A scritp that says a list of words, until you answer good or not for each one of them.
#
# The answers are logged into a file called `espeak-ng-say-list.log`.
#
# Usage:
#
# espeak-ng-say-list.sh LIST [VOICE]