Skip to content

Instantly share code, notes, and snippets.

View kwakwaversal's full-sized avatar

Paul Williams kwakwaversal

View GitHub Profile
@kwakwaversal
kwakwaversal / mogrify.sh
Created December 21, 2020 16:25
#shell `mogrify` and retain original timestamp
#!/bin/bash
# Pass a file to mogrify, but retain the timestamp to the nearest second.
#
# Amend the mogrify line below with the correct parameters.
#
# Parameters:
# The input file and nothing else.
#
# Return codes:
@kwakwaversal
kwakwaversal / jsDoc-cheatsheet.md
Last active November 19, 2022 23:58
jsDoc cheatsheet #javascript #boilerplate

jsDoc cheatsheet #javascript #boilerplate

A collection of [jsDoc] blocks for reference when coding in JavaScript.

'use strict';

/**
 * @fileOverview Class handling email-related functions.
 * @module Email
@kwakwaversal
kwakwaversal / README.md
Last active October 22, 2017 19:33
README boilerplate. #git #markdown

repository-name

A brief summary of this [Git] repository.

Description

A longer description of this repository or its intentions.

Table of contents

  1. Installation
  2. Configuration
@kwakwaversal
kwakwaversal / putty-settings.md
Last active September 12, 2018 20:16
Putty settings for optimal session #shell
@kwakwaversal
kwakwaversal / podrenderer.sh
Last active September 18, 2017 14:25
Mojolicious one-liner. Ideal for checking the POD for your Perl apps or libraries. Starts a web server with `/perldoc` links for all of the files in the `lib` folder relative to your current `pwd`. #mojo #perl
#!/usr/bin/env bash
# Mojolicious one-liner. Ideal for checking the POD for your Perl apps or
# libraries.
#
# Starts a web server with `/perldoc` links for all of the files in the `lib`
# folder relative to your current `pwd`.
#
# The POD documentation for the linked file will only display if it's included
# in the file. If it isn't, it will redirect to `metacpan.org` to try and find
@kwakwaversal
kwakwaversal / pod-distribution.pl
Last active August 1, 2019 15:09
POD outline for a distribution (you should cherry pick suitable headings and paragraphs) #perl #boilerplate
package MyDistribution::SomeModule;
1;
__END__
=encoding utf8
=head1 NAME
@kwakwaversal
kwakwaversal / withroles_rollback.t
Last active September 18, 2017 14:30
A placeholder rollback role which can be used by other roles to reset state #mojo #perl
package Test::Mojo::Role::Rollback;
use Role::Tiny;
sub rollback { }
1;
package Test::Mojo::Role::MyLogin;
use Role::Tiny;
use Test::More;
@kwakwaversal
kwakwaversal / URLQueue.pl
Last active September 18, 2017 14:30 — forked from jberger/URLQueue.pl
Modularization of my answer from SO on URL queuing for non-blocking ua #mojo #perl
#!/usr/bin/env perl
package Mojo::URLQueue;
use Mojo::Base 'Mojo::EventEmitter';
use Mojo::UserAgent;
has queue => sub { [] };
has ua => sub { Mojo::UserAgent->new(max_redirects => 5) };
has concurrency => 4;
@kwakwaversal
kwakwaversal / install-guest-additions.sh
Last active July 23, 2018 21:04 — forked from fernandoaleman/gist:5083680
How to update VirtualBox Guest Additions for debian/jessie64 with vagrant #shell
# Start a vagrant without virtualbox guest additions
$ vagrant init debian/jessie64
$ vagrant up
# You should see a message like:
# [default] The guest additions on this VM do not match the install version of
# VirtualBox! This may cause things such as forwarded ports, shared
# folders, and more to not work properly. If any of those things fail on
# this machine, please update the guest additions and repackage the
# box.
@kwakwaversal
kwakwaversal / do_some_job.pl
Last active September 18, 2017 14:32
Minion task to access MyApp to reduce boilerplate for any standalone Minion tasks #mojo #perl
#!/usr/bin/env perl
use Mojolicious::Lite;
use FindBin;
BEGIN { unshift @INC, "$FindBin::Bin/../lib" }
use MyApp;
# Load in MyApp so we can utilise the config and database connections without
# adding unnecessary boilerplate.
my $myapp = MyApp->new;