Skip to content

Instantly share code, notes, and snippets.

Avatar

Andrew Jones andrewrjones

View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am andrewrjones on github.
  • I am andrewjones (https://keybase.io/andrewjones) on keybase.
  • I have a public key ASDFYw4PV2enzzFXZgGUXzKdulxZADoDS59h3k1FWdz1Ego

To claim this, I am signing this object:

View vitality-missing-steps.txt
Hi,
My step points are not automatically being uploaded from my Apple Watch. My workouts are, and the Vitality watch app shows my steps, but the steps are not being uploaded, and never have been.
Please find attached my step data and add my missing points. The screenshots were taken following these steps:
- Open Apple Health app
- Click on 'Activity'
@andrewrjones
andrewrjones / docker-compose-postgres.yaml
Created Oct 9, 2017
Bring up Kafka, Debezium, and Schema Registry
View docker-compose-postgres.yaml
version: '2'
services:
zookeeper:
image: debezium/zookeeper:${DEBEZIUM_VERSION}
ports:
- 2181:2181
- 2888:2888
- 3888:3888
kafka:
image: debezium/kafka:${DEBEZIUM_VERSION}
@andrewrjones
andrewrjones / asset-check.pl
Last active Aug 29, 2015
Quick and dirty Perl script to email me a report of sites possibly hosting my assets. See http://andrew-jones.com/blog/prevent-other-sites-from-serving-your-assets-with-nginx/
View asset-check.pl
#!perl
#
# See http://andrew-jones.com/blog/prevent-other-sites-from-serving-your-assets-with-nginx/
use strict;
use warnings;
use URI::Split qw(uri_split);
use Data::Dumper;
use Email::MIME;
@andrewrjones
andrewrjones / signal_test.pl
Created Mar 31, 2014
keep doing something until we catch an INT signal (Ctrl + C)
View signal_test.pl
#!perl
# keep doing something until we catch an INT signal (Ctrl + C)
use strict;
use warnings;
my $running = 1;
$SIG{INT} = sub { $running = 0 };
@andrewrjones
andrewrjones / build.xml
Last active Dec 20, 2015
Ant task to run Perl code through perltidy. Windows and Unix.
View build.xml
<!-- perltidy executable -->
<condition property="perltidy.exe" value="perltidy.bat">
<os family="windows" />
</condition>
<condition property="perltidy.exe" value="perltidy">
<os family="unix" />
</condition>
<fail unless="perltidy.exe">No perltidy executable defined for this OS</fail>
<target name="perl:tidy" description="Tidies the Perl code" depends="">
@andrewrjones
andrewrjones / yours2nginx.php
Created Apr 26, 2013
Script to migrate short URLs from YOURLs to nginx.
View yours2nginx.php
#!/usr/bin/php
<?php
/*
This script takes all the short URL's in the YOURLs database and generates
an nginx config file containing the correct redirects.
Use if you want to migrate away from YOURLs and use nginx to ensure the links
continue to work.
@andrewrjones
andrewrjones / arsenal-ticket-email.pl
Created Sep 15, 2012
Lets me know when Arsenal tickets are available
View arsenal-ticket-email.pl
#!perl
use v5.10.1;
use strict;
use warnings;
use Getopt::Long;
use Storable qw(store retrieve);
@andrewrjones
andrewrjones / gist:1876882
Created Feb 21, 2012
Slurping text from a file
View gist:1876882
sub slurp_from_file {
my ( $self, $file ) = @_;
return do {
local $/ = undef;
open my $fh, "<", $file
or die "could not open $file: $!";
my $doc = <$fh>;
# ensure there are no carriage returns
@andrewrjones
andrewrjones / HttpContextFactory.cs
Created Feb 7, 2012
Factory method to allow us to mock HttpContext when testing
View HttpContextFactory.cs
using System.Web;
namespace AndrewJones
{
/// <summary>
/// Factory method to allow us to mock HttpContext when testing
/// </summary>
public static class HttpContextFactory
{
private static HttpContextBase mockHttpContext;