Skip to content

Instantly share code, notes, and snippets.

@andyjones
andyjones / explain.pl
Last active December 23, 2015 19:19 — forked from pjlsergeant/explain.pl
Given a string, print out the codepoints that it currently compromises of
# Given a string, print out the codepoints that it currently compromises of. If
# you pass it a bytestring, you will get the bytes. If you pass it a character
# string, you will get the characters. This can be helpful when you're not sure
# if your terminal is playing around with the output.
sub explain {
# We will build up the output in $explain
my $explain;
# Split the first argument in to characters
for my $char ( split(//, shift() ) ) {
upstream docker_registry {
server 127.0.0.1:15000;
}
server {
listen 443;
root /dev/null;
index index.html index.htm;
@andyjones
andyjones / mail-spam-assassin-local-lib.patch
Last active August 29, 2015 14:02
Mail::SpamAssassin patch to install into a local::lib. Install AAAA::Mail::SpamAssassin first. Works with v 3.2.5
diff --git a/Makefile.PL b/Makefile.PL
index e47a76d..c7c4dcb 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -219,6 +219,8 @@ my %makefile = (
'Sys::Hostname' => 0,
'Time::Local' => 0,
'Errno' => 0,
+ 'Net::IP' => 0,
+ 'NetAddr::IP' => 0,
@andyjones
andyjones / kill-scm-threads.groovy
Created September 23, 2014 12:19
Kills long running SCM polling threads in Jenkins
Jenkins.instance.getTrigger("SCMTrigger").getRunners().each()
{
item ->
long millis = Calendar.instance.time.time - item.getStartTime()
if(millis > (1000 * 60 * 60)) // 1000 millis in a second * 60 seconds in a minute * 3 minutes
{
Thread.getAllStackTraces().keySet().each()
{
tItem ->
use strict;
use warnings;
use Test::More;
use Test::Fatal;
use Class::MOP;
use Class::MOP::Class;
{
@andyjones
andyjones / mouse-constant.t
Last active August 29, 2015 14:14
Simplified version of t/mouse.t from namespace::autoclean that fails under perl 5.8.8
use strict;
use warnings;
use Test::More 0.88;
# Create a role
BEGIN {
package Some::Role;
use Mouse::Role;
use namespace::autoclean;
@andyjones
andyjones / global-approach.patch
Last active September 20, 2015 13:40
Avoid `arch/auto/Sereal/Encoder/Encoder.so: undefined symbol: DPPP_my_newSV_type` on perl 5.8.8
index abfbd02..9bc2189 100644
--- a/Perl/Encoder/Encoder.xs
+++ b/Perl/Encoder/Encoder.xs
@@ -5,7 +5,7 @@
#include "perl.h"
#include "XSUB.h"
-#define NEED_newSV_type
+#define NEED_newSV_type_GLOBAL
#include "ppport.h"

This is a list of articles/books/videos that have influenced me :)

There isn't a particular order to this list. I recommend them all but there are a couple that stand out. I have marked these with ✨

Life/inspiration

@andyjones
andyjones / display-entry.php
Created January 22, 2018 14:09
Displays the debug xml for a Symphony 2 entry
<?php
function initialiseSymphony() {
// Config hacks (not required in symphony 2.7)
date_default_timezone_set('UTC');
// Find out where we are:
define('DOCROOT', __DIR__);
// Propagate this change to all executables:
chdir(DOCROOT);