Skip to content

Instantly share code, notes, and snippets.

View mattheworiordan's full-sized avatar
💭
V. busy with Ably, building a great team 🚀

Matthew O'Riordan mattheworiordan

💭
V. busy with Ably, building a great team 🚀
View GitHub Profile
@mattheworiordan
mattheworiordan / keybase.md
Created February 11, 2016 14:50
keybase.md

Keybase proof

I hereby claim:

  • I am mattheworiordan on github.
  • I am mattheworiordan (https://keybase.io/mattheworiordan) on keybase.
  • I have a public key whose fingerprint is F4E4 B4C8 C3FB 6C18 61D3 72D1 256B 10AD 964D 3E59

To claim this, I am signing this object:

@mattheworiordan
mattheworiordan / by-country.csv
Created November 21, 2015 18:27
Ably realtime message - global pub/sub message latency in milliseconds (Nov 2015)
country min (ms) max (ms)
United Arab Emirates 128 207
Argentina 159 224.5
Austria 17 70
Australia 5 230
Belgium 15 73
Brazil 10 180
Canada 13 73.5
Switzerland 17 91
China, People's Republic of 80 244
@mattheworiordan
mattheworiordan / benchmark-results.txt
Created June 18, 2015 16:55
Opal.rb versus MRI Ruby
$ iojs opal.js
a-b took 0.002000093460083008s
reject..include? took 6.110000133514404s
$ ruby ruby.rb
a-b took 0.005129098892211914s
reject..include? took 0.23897528648376465s
@mattheworiordan
mattheworiordan / admin.results
Created April 2, 2015 13:01
Concurrency test
request 1 of 1: 0.10s
request 7 of 10: 0.42s
request 2 of 10: 0.44s
request 10 of 10: 0.47s
request 4 of 10: 0.50s
request 5 of 10: 0.51s
request 3 of 10: 0.52s
request 9 of 10: 0.54s
request 8 of 10: 0.60s
request 1 of 10: 0.66s
@mattheworiordan
mattheworiordan / AblyAuthenticator.java
Last active August 29, 2015 14:15
cassandra-driver CPU issue
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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
@mattheworiordan
mattheworiordan / cli.rb
Created January 9, 2015 12:21
Thor with subcommands that work correctly with help
#!/usr/bin/env ruby
require 'thor'
class SubCommandBase < Thor
def self.banner(command, namespace = nil, subcommand = false)
"#{basename} #{subcommand_prefix} #{command.usage}"
end
def self.subcommand_prefix
@mattheworiordan
mattheworiordan / influxdb log continued.log
Last active August 29, 2015 14:06
influxdb not running a web server logs
.... lots of similar entries to the ones below ranging from 1:24:13 all the way until 02:20:26 ....
[2014/09/25 02:20:26 UTC] [INFO] (github.com/influxdb/influxdb/datastore.(*ShardDatastore).GetOrCreateShard:162) DATASTORE: opening or creating shard /influxdb/data/db/shard_db_v2/00411
[2014/09/25 02:20:26 UTC] [INFO] (github.com/influxdb/influxdb/datastore.(*ShardDatastore).GetOrCreateShard:162) DATASTORE: opening or creating shard /influxdb/data/db/shard_db_v2/00214
[2014/09/25 02:20:26 UTC] [INFO] (github.com/influxdb/influxdb/datastore.(*ShardDatastore).GetOrCreateShard:162) DATASTORE: opening or creating shard /influxdb/data/db/shard_db_v2/00221
[2014/09/25 02:20:26 UTC] [INFO] (github.com/influxdb/influxdb/datastore.(*ShardDatastore).GetOrCreateShard:162) DATASTORE: opening or creating shard /influxdb/data/db/shard_db_v2/00296
[2014/09/25 02:20:26 UTC] [INFO] (github.com/influxdb/influxdb/datastore.(*ShardDatastore).GetOrCreateShard:162) DATASTORE: opening or creating shard /influxdb/data/db/shard_db_v2
@mattheworiordan
mattheworiordan / example_json_failure.rb
Created August 14, 2014 12:21
json-minify-rb gem issue
JSON.minify('{ "PolicyName": { "Fn::Join" : [ "", [ "AblySnsPublish-", { "Ref" : "AWS::Region" }, "-", { "Ref" : "DataCenterID" } ] ] } }')
SyntaxError: Unable to pre-scan string: AblySnsPublish-", { "Ref" : "AWS::Region" }, "-", { "Ref" : "DataCenterID" } ] ] } }
from /Users/matthew/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/json-minify-0.0.1/lib/json/minify.rb:43:in `minify'
from (irb):2
from /Users/matthew/Projects/Ably/infrastructure/lib/ably_env/cli.rb:70:in `console'
from /Users/matthew/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
from /Users/matthew/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
from /Users/matthew/Projects/Ably/infrastructure/lib/ably_env/cli.rb:105:in `block in invoke_command'
from /Users/matthew/Projects/Ably/infrastructure/lib/ably_env/exception_reporting.rb:28:in `catch_and_report'
@mattheworiordan
mattheworiordan / example_searches.rb
Last active August 29, 2015 14:04
Facets for Econsultancy based on our user interface design intentions
MODELS = [
'BlogPost',
'Event',
'PressRelease',
'Report',
'CaseStudy',
'TrainingCourse'
]
# Example search for just "test" with no filters, note, topics are ommitted from this example because too many results to be readable
@mattheworiordan
mattheworiordan / application.rb
Created March 28, 2014 09:05
CloudFlare IP Middleware for Rails to ensure HTTP_CF_CONNECTING_IP is used and the clients IP is correct within Rails
module RailsAppName
class Application < Rails::Application
# .... your settings
require "#{Rails.root}/lib/cloud_flare_middleware"
config.middleware.insert_before(0, Rack::CloudFlareMiddleware)
# ... your settings
end
end