Skip to content

Instantly share code, notes, and snippets.

View JRaspass's full-sized avatar

James Raspass JRaspass

View GitHub Profile
Classic
=======
Using a fixed budget pick the best team you can.
Head-to-Head
============
No budget, take turns picking, no dupes allowed.
Podium Pick
===========
#!/usr/bin/env perl6
use Cro::HTTP::Client;
my @langs = (
'Julia',
'https://julialang.org/downloads/',
/"stable release: v"(.+?)"<"/,
'Perl',
var rockPaperScissorsSpockLizardGames = [...][2]string{
{"💎💎", "Tie"},
{"💎📄", "📄 covers 💎"},
{"️💎️✂️", "💎 crushes ✂️"},
{"💎🖖", "🖖 vaporizes 💎"},
{"💎🦎", "💎 crushes 🦎"},
{"📄💎", "📄 covers 💎"},
{"📄📄", "Tie"},
{"️📄✂️", "✂️ cuts 📄"},
{"📄🖖", "📄 disproves 🖖"},
'use strict';
const imgs = document.querySelectorAll('[data-src]');
if ('IntersectionObserver' in window) {
const observer = new IntersectionObserver(entries => {
for (const entry of entries)
if (entry.isIntersecting) {
entry.target.src = entry.target.dataset.src;
observer.unobserve(entry.target);
$ docker run --rm alpine:edge sh -c 'apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing firefox strace && strace firefox -headless' 2>&1 | tail
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x98} ---
unlink("/root/.mozilla/firefox/apgg61bn.default-default/lock") = 0
close(4) = 0
rt_sigaction(SIGSEGV, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7f8383102aaf}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [SEGV], NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1 RT_2], [], 8) = 0
tkill(26, SIGSEGV) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
--- SIGSEGV {si_signo=SIGSEGV, si_code=SI_TKILL, si_pid=26, si_uid=0} ---
package password
import (
"crypto/rand"
"crypto/subtle"
"encoding/base64"
"errors"
"fmt"
"strings"
$ perl6 -e '.say for Date.today.truncated-to("month") ... Date.today'
2019-10-01
2019-10-02
2019-10-03
2019-10-04
2019-10-05
2019-10-06
2019-10-07
2019-10-08
db=> truncate account;
TRUNCATE TABLE
db=> with add as (insert into account (oidc, sub) values ('google', 'foo') on conflict do nothing returning id) select * from add union select id from account where oidc = 'google' and sub = 'foo';
11
db=> with add as (insert into account (oidc, sub) values ('google', 'foo') on conflict do nothing returning id) select * from add union select id from account where oidc = 'google' and sub = 'foo';
11
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
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';