Skip to content

Instantly share code, notes, and snippets.

@maspalio
maspalio / runner.js
Last active August 29, 2015 14:27 — 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.
/*
* 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.
@maspalio
maspalio / gist:e8e0ce68587231a8ad38
Created September 9, 2015 11:31
Static web site from Dancer via Wallflower
#!/usr/bin/env perl
use Dancer;
use File::Copy;
use Wallflower;
use My::App;
my $app = sub {
my $env = shift;
#!/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:1396412fcfc0d9e2f6b0
Created January 5, 2016 12:24
mkpasswd -m sha-512 $pass $( openssl rand -base64 16 | tr -d '+=' | head -c 16 )
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;
@maspalio
maspalio / semver.t
Last active May 6, 2020 17:12
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