Skip to content

Instantly share code, notes, and snippets.

View jberger's full-sized avatar

Joel Berger jberger

View GitHub Profile
{
foo => 1,
plugins => [
{'HypnotoadRestarter' => {}},
]
}
cpanm (App::cpanminus) 1.7044 on perl 5.032000 built for darwin-2level
Work directory is /Users/joel/.cpanm/work/1613232918.271
You have make /usr/bin/make
You have /usr/local/bin/wget
You have /usr/bin/tar: bsdtar 3.3.2 - libarchive 3.3.2 zlib/1.2.11 liblzma/5.0.5 bz2lib/1.0.6
You have /usr/bin/unzip
Entering /Users/joel/Programs/Sites/mojolicious.io
Checking if you have Syntax::Highlight::Engine::Kate 0 ... Yes (0.14)
Checking if you have Statocles 0.093 ... No
Searching Statocles (0.093) on cpanmetadb ...
#!/usr/bin/env perl
use strict;
use warnings;
use App::cpm::CLI;
use File::Spec;
use Carton::CPANfile;
use Carton::Snapshot;
select '1..1';
select 'ok 1' where 1=1;
-- run with: prove -e 'psql -At -f' test.sql
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: demo
labels:
app: demo
spec:
replicas: 1
selector:
@jberger
jberger / app.psgi
Last active December 17, 2020 04:48
Post-processing HTML with Mojo::DOM (in Dancer2)
use Dancer2;
set views => '.';
any '/' => sub {
template 'welcome';
};
any '/toyshop' => sub {
template 'toyshop';
use Mojolicious::Lite;
use Mojo::JWT;
use Mojo::URL;
use Mojo::UserAgent;
my $ua = Mojo::UserAgent->new;
my $keycloak = $ua->get('https://keycloak.jberger.pl/auth/realms/master/.well-known/openid-configuration')->result->json;
my $jwkset = $ua->get($keycloak->{jwks_uri})->result->json;
export function Fetcher (options) {
if (options.base) this.base = options.base;
};
Fetcher.prototype.fetch = function(input, init) {
if (input instanceof Request) {
return window.fetch(input, init);
}
let url = this.base ? new URL(input, this.base) : new URL(input);
my $x = {
a => 1,
b => 2,
};
$x->{ref}{a} = $x->{a};
$x; # this must be last
@jberger
jberger / dbix_async
Created June 26, 2020 15:49
DBIC / DBIx::Class Async Notes
https://github.com/mcsnolte/Mojo-Pg-DBIC/commit/4f9d48cf52e6aecd782f1e2e20e1e1ae07a795a3#r17468260
https://gist.github.com/ribasushi/032fbb8b58e2b0d62fae#file-gistfile1-txt-L474-L490
I'm leaving these here because I keep thinking that they ARE here and they aren't ... until now.