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 / example_integration_test.rb
Last active August 29, 2015 13:57
Proposed DLS and structure for our tests using Page objects
require 'integration/spec_helper'
feature 'New user sign up', :js => true do
pages :home_page, :registration_page, :registration_complete_page
let(:user_email) { 'matt@econsultancy.com' }
scenario %{
User arrives on the home page, follows the sign up promotion,
fills in the form incorrectly, then corrects their mistakes,
@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 / 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 / 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 / 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 / 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 / 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
require 'growl'
require 'open3'
ENV["WATCHR"] = "1"
$spec_cmd = "rspec --tty --drb --colour --format nested"
$cuke_cmd = "cucumber --color --drb --require features/step_definitions --require features/support"
$pass = File.join(File.expand_path(File.dirname(__FILE__)), '.watchr_images', 'pass.png')
$fail = File.join(File.expand_path(File.dirname(__FILE__)), '.watchr_images', 'fail.png')
$pending = File.join(File.expand_path(File.dirname(__FILE__)), '.watchr_images', 'pending.png')
scenario "have ability to edit profile", :js => true do
@ability.should be_able_to(:edit, @profile)
end
@mattheworiordan
mattheworiordan / Gemfile
Created April 16, 2011 17:05
gemfile for RSpec
gem 'spork', '~> 0.9.0.rc'