Skip to content

Instantly share code, notes, and snippets.

Avatar

Xavier Caron maspalio

View GitHub Profile
View semver.t
#!/usr/bin/env perl
use Modern::Perl;
use Path::Tiny;
use Test::More;
my $expected = shift // 'pg-semver/test/expected/base.out';
# https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
@maspalio
maspalio / gist:1396412fcfc0d9e2f6b0
Created Jan 5, 2016
mkpasswd -m sha-512 $pass $( openssl rand -base64 16 | tr -d '+=' | head -c 16 )
View gist:1396412fcfc0d9e2f6b0
sub hashed_password {
my ( $pass ) = @_;
# mkpasswd -m sha-512 $pass $( openssl rand -base64 16 | tr -d '+=' | head -c 16 )
my $get_salt = sub {
my ( $out, $err );
my @command = split ' ', 'openssl rand -base64 16';
run3 \@command, undef, \$out, \$err;
View app.psgi
#!/usr/bin/env perl
use strict;
use warnings;
use Plack::App::Directory;
use Plack::Builder;
my $pad = Plack::App::Directory->new->to_app;
@maspalio
maspalio / gist:e8e0ce68587231a8ad38
Created Sep 9, 2015
Static web site from Dancer via Wallflower
View gist:e8e0ce68587231a8ad38
#!/usr/bin/env perl
use Dancer;
use File::Copy;
use Wallflower;
use My::App;
my $app = sub {
my $env = shift;
@maspalio
maspalio / runner.js
Last active Aug 29, 2015 — forked from SimplGy/runner.js
Updated PhantomJS QUnit runner to support RequireJS and CurlJS modules, which can load *after* QUnit.done is called. Also improved the console output and added a global timeout. If your test suite takes longer than `timeLimit` to run, it'll fail.
View runner.js
/*
* QtWebKit-powered headless test runner using PhantomJS
*
* PhantomJS binaries: http://phantomjs.org/download.html
* Requires PhantomJS 1.6+ (1.7+ recommended)
*
* Run with:
* phantomjs runner.js [url-of-your-qunit-testsuite]
*
* e.g.
You can’t perform that action at this time.