Skip to content

Instantly share code, notes, and snippets.

miike

Block or report user

Report or block miike

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am miike on github.
  • I am mrobins (https://keybase.io/mrobins) on keybase.
  • I have a public key ASA7tIoEXO_AsTytxhGro66iXXF64haWrJzyvSqNCNbi4wo

To claim this, I am signing this object:

@miike
miike / validateSchema.js
Created Jan 17, 2017
Validating JSON schemas
View validateSchema.js
var Validator = require('jsonschema').Validator;
var v = new Validator();
var collectSchema = {
"$schema": "http://iglucentral.com/schemas/com.snowplowanalytics.self-desc/schema/jsonschema/1-0-0#",
"description": "Additional properties about how audio/video was consumed when embedded in other content (such as in an article)",
"self": {
"vendor": "au.net.abc.snowplow",
"name": "embed_context",
"format": "jsonschema",
@miike
miike / request_spot.json
Created Dec 31, 2016
Request a p2.xlarge instance for fast.io
View request_spot.json
{
"DryRun": false,
"SpotPrice": "0.20",
"InstanceCount": 1,
"Type": "one-time",
"LaunchSpecification": {
"ImageId": "ami-b43d1ec7",
"KeyName": "fastio",
"UserData": "",
"InstanceType": "p2.xlarge",
@miike
miike / decode.py
Created Dec 12, 2016
Decoding Snowplow real-time bad rows
View decode.py
# accompanying tutorial:
import base64
import thriftpy
from thriftpy.protocol import TCyBinaryProtocolFactory
from thriftpy.utils import deserialize, serialize
sample_payload = "CwFAAAAAAi9pCwBkAAAACTEyNy4wLjAuMQoAyAAAAVjbnjdoC3ppAAAAQWlnbHU6Y29tLnNub3dwbG93YW5hbHl0aWNzLnNub3dwbG93L0NvbGxlY3RvclBheWxvYWQvdGhyaWZ0LzEtMC0wCwFKAAABaHN0bT0xNDgxMTUzMzI5MDAwJmU9cHYmdXJsPWh0dHAlM0ElMkYlMkZzbm93Zmxha2UtYW5hbHl0aWNzLmNvbSZ0dj1qcy0yLjYuMCZ0bmE9anMtMy42LjAmYWlkPXNub3dmbGFrZSZwPXdlYiZ0ej1BdXN0cmFsaWElMkZTeWRuZXkmbGFuZz1lbi1BVSZjcz1VVEYtOCZyZXM9MzYweDY0MCZjZD0zMiZjb29raWU9MSZlaWQ9YzI1OWMyNWUtZjk0Yi00ZDJjLWExMWMtMGQyNzhjMmU2ZDFhJmR0bT0xNDc5OTI3ODU3MjAxJnZwPTB4LTU2JmRzPTIwMHgyNjI5NSZ2aWQ9NCZzaWQ9N2ZiOTdmQzYtNmUwZi00MDIyLWFkYmQtMDE3NDMxNTIwZGRiJmR1aWQ9NGQxMGQzZDAtYzJiNC00NzNlLWE0ODMtODEyNzk5ZTgyNGQxJmZwPTEyOTExMjMzMgsBLAAAAG1Nb3ppbGxhLzUuMCAoV2luZG93cyBOVCAxMC4wOyBXT1c2NCkgQXBwbGVXZWJLaXQvNTM3LjM2IChLSFRNTCwgbGlrZSBHZWNrbykgQ2hyb21lLzU0LjAuMjg0MC43MSBTYWZhcmkvNTM3LjM2CwGQAAAAIWNvbGxlY3Rvci5zbm93Zmxha2UtYW5hbHl0aWNzLmNvbQsA
@miike
miike / gist:4f342db2b88c4a029c53
Created Dec 2, 2015
Sed expression to extract row values out of Wikipedia iwlink dumps
View gist:4f342db2b88c4a029c53
sed -re 's#\\\"#"#g' -e 's#"#""#g' -e "s#\\(([0-9]+)\s*,\s*'((\\\'|[^'])*)'\s*,\s*'((\\\'|[^'])*)'\)\s*[,;]?\s*#\1,\"\2\",\"\4\"\n#g" -e "s#\\\'#'#g" enwiki-latest-iwlinks.sql
You can’t perform that action at this time.