Skip to content

Instantly share code, notes, and snippets.

use strict;
use warnings;
use 5.010;
my $var;
$var //= 2;
say $var;
my @array_multiplied = qw(3 5 7) x 3;
@mateu
mateu / gist:2902025
Created June 9, 2012 18:08
testicle
festival
@mateu
mateu / gist:c08f6084c8d1516166b6
Created January 22, 2015 18:14
generate a warning for an incorrect Content-Length header
#!/usr/bin/env perl
use strict 'vars';
use warnings;
use Plack;
use Plack::Test::Agent;
use Socket;
my $server = 'Standalone';
@mateu
mateu / debug-war-crash.log
Created July 31, 2025 21:58
Ways to debug warp terminal crashing on startup on Mac OS
Prompt> How does one debug a crash with warp terminal on startup?
Here are several approaches to debug a Warp terminal crash on startup:
## 1. Check Crash Logs
First, look for crash logs in the system logs:
# Check system logs for Warp crashes
log show --predicate 'process == "Warp"' --last 1h
# Or check Console.app for crash reports
@mateu
mateu / deterministic-split.py
Created August 21, 2025 19:35
Split jsonl in manner that is determistic when the random_seed is fixed.
import orjson # pip install orjson
import hashlib
def deterministic_split_jsonl_orjson(input_file, train_file, test_file,
id_field='id', test_ratio=0.2, random_seed=42):
train_count = 0
test_count = 0
threshold = int(test_ratio * 2**32)