This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Update stars. | |
my %queries; | |
for $db.query(q:to/SQL/).arrays { | |
SELECT DISTINCT url FROM dists WHERE url ~ '^https://git(hub|lab)\.com/' | |
SQL | |
my ( $, $, $domain, $owner, $repo ) = .split("/"); | |
my $id = 'i' ~ ++$; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my $date = '09 May 2008'; | |
constant %months = enum «:1Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec»; | |
$date ~~ / $<day> = \d+ ' ' $<month> = @( %months.keys ) ' ' $<year> = \d+ /; | |
say Date.new: |$/.hash, :month( %months{ $<month> } ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package hole | |
import ( | |
"math/rand" | |
"strings" | |
) | |
func brainfuck() ([]string, string) { | |
args := []string{ | |
..., |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use constant RAT => '...'; | |
use HTTP::Tiny; | |
use JSON::PP; | |
my $ua = HTTP::Tiny->new; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unit module TOML::Tiny; | |
# FIXME Raku needs a Time. | |
class Time does Dateish { | |
has $.hour; | |
has $.minute; | |
has $.second; | |
method !formatter() { | |
sprintf '%02d:%02d:%s', $!hour, $!minute, $!second.floor == $!second |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
given %fields<dependency.version>[$_] { | |
when 0 | 5 { } | |
when 6 { %dist<perl> = 6 } | |
when /v( '5.' \d+ )/ { %dist<perl> = ~$0 if $0 != 5 } | |
when /(\d\.) (\d ** ^4)/ { %dist<perl> = $0 ~ +"{$1}00".substr(^3) if +$1 } | |
default { note "Unknown version '$_' $dist" } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- a/lib/TOML/Tiny.pm6 | |
+++ b/lib/TOML/Tiny.pm6 | |
@@ -23,7 +23,8 @@ grammar Grammar { | |
proto token value {*} | |
+ rule value:sym<array> { '[' <value>* % ',' ']' } | |
token value:sym<datetime> { \d\d [\d\d] ** 3 % '-' T <value:time> Z } | |
token value:sym<date> { \d\d [\d\d] ** 3 % '-' } | |
token value:sym<false> { <sym> } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grammar Grammar { | |
rule TOP { <table>+ } | |
rule table { '[' '"'? <key> '"'? ']' <key-val>+ } | |
rule key-val { <key> '=' <val> } | |
token key { <[ A .. Z a .. z 0 .. 9 . _ + - ]>+ } | |
proto token val {*} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Cro::HTTP::Client; | |
# data,deprecated,license | |
my $url = 'http://fastapi.metacpan.org/v1/release/_search' | |
~ '?fields=dependency.module,dependency.version,main_module' | |
~ '&filter_path=_scroll_id,hits.hits.fields' | |
~ '&q=status:latest' | |
~ '&scroll=1m' | |
~ '&size=5000'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GET /log-in | |
Click on "Log In with Google" | |
GET /log-in/google | |
307 Temporary Redirect | |
Location: //accounts.google.com/o/oauth2/auth?state=xxx&... | |
Set-Cookie: __Host-csrf=xxx; HttpOnly; Path=/; SameSite=Lax; Secure |
NewerOlder