Skip to content

Instantly share code, notes, and snippets.

View arkiuat's full-sized avatar

Eric Forste arkiuat

View GitHub Profile
@arkiuat
arkiuat / proposed-addition-to-Instant.rakudoc
Last active December 9, 2025 20:13
proposed addition to Type/Instant.rakudoc addressing docs issue #3881
=head1 Leap Seconds
POSIX time (commonly called "Unix time") makes the incorrect assumption that
the period of rotation of the Earth is a fixed constant. Since in fact the
number of seconds that pass between one noon and the next varies from day to
day, we must occasionally have a 61st second in the 60th minute of some hour;
this is called a leap second, and happens at the same time all over the world,
and therefore at different times of day in different timezones.
POSIX deals with this by assigning the same integer label to two different
my constant @lsmonth := <
1972-06 1972-12 1973-12 1974-12 1975-12 1976-12 1977-12 1978-12 1979-12
1981-06 1982-06 1983-06 1985-06 1987-12 1989-12 1990-12 1992-06 1993-06
1994-06 1995-12 1997-06 1998-12 2005-12 2008-12 2012-06 2015-06 2016-12
>;
sub leap-sec( Int(Str) $year, Int(Str) $month --> DateTime ) {
DateTime.new(
date => Date.new($year, $month, 1).last-date-in-month,
:23hour,
:59minute,
@arkiuat
arkiuat / gist:16268cd0a32ec08ecfac3c5da6f1aeef
Created July 31, 2025 16:54
color changes for Raku in NeoVim ~/.config/nvim/init.vim
highlight rakuComment ctermfg=Red guifg=Red
highlight rakuVariable ctermfg=Green guifg=Green
highlight rakuVarName ctermfg=Green guifg=Green
highlight rakuType ctermfg=Blue guifg=Blue
highlight rakuVarStorage ctermfg=Gray guifg=Gray