Skip to content

Instantly share code, notes, and snippets.

@Vashy
Vashy / Java8Pills.md
Last active March 4, 2021 16:25
Java 8 pills

Java 8 Pills

Example class

@Value // Lombok annotation.
// Generates all private final fields, an all-args-constructor,
// getters (no setters), toString(), etc...
class User {
@Vashy
Vashy / README.md
Created January 14, 2021 20:50
D20pfsrd Popups Autoremover
<?php
function validateFiscalCode($fiscalCode) {
$regex = "/^[A-Z]{6}\d{2}[A-G]\d{2}[A-Z]\d{3}[A-Z]$/";
return preg_match($regex, trim($fiscalCode, " "));
}
function birthYear($fiscalCode) {
$birthYear = substr($fiscalCode, 6, 2);
if ($birthYear <= "99" && $birthYear > "25")
@Vashy
Vashy / calculate.py
Last active March 12, 2019 22:55
RPG equip cost calculator
#!/usr/bin/env python3
"""Usage: python3 calculate.py "path/to/file"
PRE: input file format example. csv-like file:
unitary cost, moltiplicator (optional), name or descriptor
Scrolls
12,5 5x Mage Armor scroll (CL1)
12,5 2x Shield scroll (CL1)
37,5 2 Shield scroll (CL3)