Skip to content

Instantly share code, notes, and snippets.

@rbramley
rbramley / keybase.md
Created January 25, 2019 10:48
Keybase

Keybase proof

I hereby claim:

  • I am rbramley on github.
  • I am rbramley (https://keybase.io/rbramley) on keybase.
  • I have a public key ASC71to_cVAewQ77VuUV4CpZEqsRJahjOmNulEO_B1CJ4Qo

To claim this, I am signing this object:

@rbramley
rbramley / CloudEvents-0.1.avsc
Created April 6, 2018 17:07
CloudEvents 0.1 Avro schema (draft)
{
"namespace": "CloudEvents",
"type": "record",
"name": "Event",
"fields": [
{"name": "cloudEventsVersion", "type": "string", "doc": "The version of the CloudEvents specification which the event uses. This enables the interpretation of the context."},
{"name": "eventType", "type": "string", "doc": "Type of the event data. Producers can specify the format of this, depending on their service. This enables the interpretation of data, and can be used for routing, policy and more."},
{"name": "eventTypeVersion", "type": ["null", "string"], "doc": "The version of the event-type. This enables the interpretation of data by eventual consumers, requires the consumer to be knowledgeable about the producer."},
{"name": "source", "type": "string", "doc": "This describes the event producer. Often this will include information such as the type of the event source, the organization publishing the event, and some unique idenfitiers. The exact syntax and semantics behind the data encoded in the URI is e
@rbramley
rbramley / AndroidEmailAccounts.groovy
Created September 22, 2015 17:48
Companion gist for email extraction to list accounts & mailboxes
/**
* Copying and distribution of this file, with or without modification,
* are permitted in any medium without royalty provided the copyright
* notice and this notice are preserved. This file is offered as-is,
* without any warranty.
*
* Script to list accounts/mailboxes from an Android ADB email dump.
*
* @author Robin Bramley (c) 2015
*/
/**
* Copying and distribution of this file, with or without modification,
* are permitted in any medium without royalty provided the copyright
* notice and this notice are preserved. This file is offered as-is,
* without any warranty.
*
* Script to take an Android ADB email dump and process emails to .eml RFC822
* format files. Does not handle attachments/multipart at present.
*
* <em>Notes:</em>
@rbramley
rbramley / blueprints_rdf_graphsail_neo4j.groovy
Created January 7, 2014 17:01
An executable Groovy script to create and query some simple RDF statements within a Neo4j database using the Blueprints GraphSail ouplementation. Based on sample code from the Tinkerpop wiki: https://github.com/tinkerpop/blueprints/wiki/Sail-Ouplementation It sources dependencies from Maven Central using Grape.
@Grab(group='com.tinkerpop.blueprints', module='blueprints-neo4j-graph', version='2.4.0')
@Grab(group='com.tinkerpop.blueprints', module='blueprints-graph-sail', version='2.4.0')
@Grab(group='org.openrdf.sesame', module='sesame-repository-sail', version='2.7.8')
@Grab(group='org.openrdf.sesame', module='sesame-queryparser-sparql', version='2.7.8')
import com.tinkerpop.blueprints.*
import com.tinkerpop.blueprints.oupls.sail.GraphSail
import com.tinkerpop.blueprints.impls.neo4j.Neo4jGraph
import info.aduna.iteration.*
@rbramley
rbramley / IssueMigrator.groovy
Created March 2, 2013 21:43
Script to migrate GoogleCode issues
/**
* Copying and distribution of this file, with or without modification,
* are permitted in any medium without royalty provided the copyright
* notice and this notice are preserved. This file is offered as-is,
* without any warranty.
*
* Migrate issues from one Googlecode project to another (e.g. if you need to rename).
* Note (line 39): fetch of issues from source project currently limited to 50
*
* See: http://code.google.com/p/support/wiki/IssueTrackerAPI for API details
@rbramley
rbramley / walk_and_count.groovy
Created May 4, 2012 12:26
Quick & dirty Groovy scripts for processing Freemind leaf nodes
/**
* Copying and distribution of this file, with or without modification,
* are permitted in any medium without royalty provided the copyright
* notice and this notice are preserved. This file is offered as-is,
* without any warranty.
*
* @author Robin Bramley (c) 2012
*
* Groovy script to walk a Freemind node tree and count occurrences of leaf terms.
*/
@rbramley
rbramley / CreateSonarPom.groovy
Created July 29, 2011 21:46
A Grails Gant script to create a Maven POM for the Sonar Groovy Plugin
/*
* Copyright 2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@rbramley
rbramley / map_counter_bump.groovy
Created June 24, 2011 15:52
Groovy meta-programming to 'bump' a counter in a map
/**
* Copying and distribution of this file, with or without modification,
* are permitted in any medium without royalty provided the copyright
* notice and this notice are preserved. This file is offered as-is,
* without any warranty.
*
* @author Robin Bramley (c) 2011
*
* Groovy meta-programming to 'bump' a counter in a map for conciseness.
*/
@rbramley
rbramley / DuplicateId_LuceneIndexWalker.groovy
Created June 23, 2011 16:29
Script to walk an unoptimised Lucene index to determine how many deletions were due to updates
/**
* Copying and distribution of this file, with or without modification,
* are permitted in any medium without royalty provided the copyright
* notice and this notice are preserved. This file is offered as-is,
* without any warranty.
*
* @author Robin Bramley (c) 2011
*
* Purpose:
* Of the deletions in an unoptimised Lucene index, how many were