Skip to content

Instantly share code, notes, and snippets.

View mrenvoize's full-sized avatar
🏠
Working from home

Martin Renvoize mrenvoize

🏠
Working from home
View GitHub Profile
package Rebus;
use Mojo::Base 'Mojolicious';
use Rebus::Schema;
use DBIx::Class::DeploymentHandler;
use strict;
use warnings;
use utf8;
package Rebus::Schema::Result::Report;
=head1 NAME
Rebus::Schema::Result::Report
=cut
@mrenvoize
mrenvoize / list.sh
Last active March 18, 2016 13:23
hypnotoad init multi
#!/bin/bash
### BEGIN INIT INFO
# Provides: rebus-list
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Provides Hypnotoad Workers for rebus:list
# Description: This script with start/stop hypnotoad worker
@mrenvoize
mrenvoize / rebus-minion.sh
Created February 8, 2016 07:25
init.d script for starting multiple minion workers (Mojolicious)
#!/bin/bash
### BEGIN INIT INFO
# Provides: rebus-minion
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Provides Minion Workers for rebus:list jobs
# Description: This script with start/stop minion worker
@mrenvoize
mrenvoize / install-plenv.sh
Created December 9, 2015 12:27 — forked from revmischa/install-plenv.sh
Set up plenv, install perl, cpanm, carton, set up environment
#!/bin/bash
# installs plenv, perl, carton, cpanminus, sets up environment in .bash_profile
# from https://github.com/tokuhirom/plenv#readme
PLENV_PERL_VERSION='5.18.1'
if [[ -n "$PERL_MB_OPT" ]]; then
echo "You must unset your local::lib environment variables first"
@mrenvoize
mrenvoize / db.pl
Created November 17, 2015 09:45
Mojolicious DBIx::Class::DeploymentHandler Example
package Rebus::Command::db;
use Mojo::Base 'Mojolicious::Command';
use DBIx::Class::DeploymentHandler;
use Getopt::Long qw(GetOptions :config pass_through);
use File::Path qw(remove_tree);
has description => '';
has usage => '';
@mrenvoize
mrenvoize / Note
Created September 24, 2015 11:28
JSON Schema Failure
Note the 'required' fields inthe schema are id + text.. however the latter json object is passing validation?
@mrenvoize
mrenvoize / csl-data.json
Created September 16, 2015 11:29
json-schema example
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "https://site.rebuslist.com/schemas/csl-data.json",
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"article",
"article-journal",
@mrenvoize
mrenvoize / With delay
Last active August 29, 2015 14:25
Mojolicious UA with Delay
my $delay = Mojo::IOLoop->delay(
sub {
my $delay = shift;
@mrenvoize
mrenvoize / SchemaValidator.plx
Last active August 29, 2015 14:24
SchemaValidator following $ref
#!/usr/bin/env perl
use strict;
use warnings;
use FindBin;
BEGIN { unshift @INC, "$FindBin::Bin/../lib" }