Skip to content

Instantly share code, notes, and snippets.

View JRaspass's full-sized avatar

James Raspass JRaspass

View GitHub Profile
# 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' ~ ++$;
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> } );
package hole
import (
"math/rand"
"strings"
)
func brainfuck() ([]string, string) {
args := []string{
...,
use strict;
use warnings;
use constant RAT => '...';
use HTTP::Tiny;
use JSON::PP;
my $ua = HTTP::Tiny->new;
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
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" }
}
--- 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> }
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 {*}
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';
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