Skip to content

Instantly share code, notes, and snippets.

Avatar

Sebastian Riedel kraih

View GitHub Profile
@kraih
kraih / local_lib.txt
Created Jun 5, 2019
Use multiple versions of the same Perl library with local::lib
View local_lib.txt
$ cpanm -Lperltidy_new Perl::Tidy
--> Working on Perl::Tidy
...
1 distribution installed
$ cpanm -Lperltidy_old Perl::Tidy@20181120
--> Working on Perl::Tidy
...
1 distribution installed
@kraih
kraih / Auth.pm
Last active Sep 25, 2018
Bits and pieces that will hopefully some day become an OpenID plugin for Mojolicious (with alternative dummy backend for testing and token backend for API users)
View Auth.pm
package MyApp::Controller::Auth;
use Mojo::Base 'Mojolicious::Controller';
sub check {
my $self = shift;
my $role = $self->stash('role');
my $user = $self->current_user;
# User needs to log in or a different role
View .hyper.js
module.exports = {
config: {
backgroundColor: "#2e3440",
borderColor: "#3b4252",
colors: {
black: "#3b4252",
blue: "#81a1c1",
cyan: "#88c0d0",
green: "#a3be8c",
lightBlack: "#4c566a",
View keybase.md

Keybase proof

I hereby claim:

  • I am kraih on github.
  • I am kraih (https://keybase.io/kraih) on keybase.
  • I have a public key whose fingerprint is 6BA8 BB3D 9A3D 17A2 DD2B ADDA A4F2 2996 1D48 27F5

To claim this, I am signing this object:

View vscode.json
{
"editor.fontFamily": "'Consolas",
"editor.fontSize": 13,
"editor.minimap.enabled": false,
"editor.renderIndentGuides": false,
"editor.renderWhitespace": "boundary",
"editor.rulers": [80],
"editor.tabSize": 2,
"emmet.includeLanguages": {
"mojolicious": "html"
View opensuse-translations.pl
#!/usr/bin/perl
use 5.24.0;
use Mojo::UserAgent;
use IO::Socket::SSL;
my %LANGUAGES = (
# SLE main languages
View fibonacci_app.pl
use Mojolicious::Lite;
use Mojo::IOLoop;
sub fib { $_[0] < 2 ? 1 : fib($_[0] - 2) + fib($_[0] - 1) }
get '/fibonacci' => sub {
my $c = shift;
$c->inactivity_timeout(300);
View chat.pl
use Mojolicious::Lite;
use Mojo::EventEmitter;
helper events => sub { state $events = Mojo::EventEmitter->new };
get '/' => 'chat';
websocket '/channel' => sub {
my $c = shift;
View fast-5.16.txt
$ perl5.16 -Mre=debug -E 'my $x = "y"; "y" =~ /z$x/ for 1 .. 2'
Compiling REx "zy"
Final program:
1: EXACT <zy> (3)
3: END (0)
anchored "zy" at 0 (checking anchored isall) minlen 2
Freeing REx: "zy"
View hello.swift
#!/usr/bin/xcrun swift -i
println("Hello World!")