Skip to content

Instantly share code, notes, and snippets.

View jstr's full-sized avatar

James Stradling jstr

  • Nelson, New Zealand
  • 16:44 (UTC +12:00)
View GitHub Profile
@jstr
jstr / calendar package.patch
Created October 19, 2017 07:30
Fix for Calendar package -- unhandled exception when RFC3339 string is missing time zone offset
diff --git a/lib/calendar/date_time/parse.ex b/lib/calendar/date_time/parse.ex
index 914247f..5d22596 100644
--- a/lib/calendar/date_time/parse.ex
+++ b/lib/calendar/date_time/parse.ex
@@ -233,6 +233,10 @@ defmodule Calendar.DateTime.Parse do
iex> rfc3339_utc("fooo")
{:bad_format, nil}
+ # Missing time zone offset
+ iex> rfc3339_utc("1996-12-19T16:39:57")
@jstr
jstr / migrate-redis.py
Created September 26, 2016 03:25 — forked from thomasst/migrate-redis.py
Migrate Redis data on Amazon ElastiCache
"""
Copies all keys from the source Redis host to the destination Redis host.
Useful to migrate Redis instances where commands like SLAVEOF and MIGRATE are
restricted (e.g. on Amazon ElastiCache).
The script scans through the keyspace of the given database number and uses
a pipeline of DUMP and RESTORE commands to migrate the keys.
Requires Redis 2.8.0 or higher.
@jstr
jstr / Accept HTTP request body in targets.patch
Created August 4, 2016 22:21
[PATCH] Accept HTTP request body content in targets file via @@ prefix
From d6fecfa5e32e692664a651ab60e0975302da7e6e Mon Sep 17 00:00:00 2001
From: James Stradling <james@thisdata.com>
Date: Wed, 27 Jul 2016 18:18:07 +1300
Subject: [PATCH] Accept HTTP request body content in targets file via @@
prefix
diff --git a/lib/targets.go b/lib/targets.go
index 394e9eb..e01105b 100644
--- a/lib/targets.go

Keybase proof

I hereby claim:

  • I am jstr on github.
  • I am jstr (https://keybase.io/jstr) on keybase.
  • I have a public key whose fingerprint is 28CC 4A6C 5B43 6611 7B52 F213 3736 22D9 B989 DC4E

To claim this, I am signing this object: