Skip to content

Instantly share code, notes, and snippets.

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 Aug 29, 2015
Proposed DLS and structure for our tests using Page objects
View example_integration_test.rb
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 Aug 29, 2015
Facets for Econsultancy based on our user interface design intentions
View example_searches.rb
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
View example_json_failure.rb
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 Aug 29, 2015
influxdb not running a web server logs
View influxdb log continued.log
.... 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 Aug 29, 2015
cassandra-driver CPU issue
View AblyAuthenticator.java
/*
* 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
View admin.results
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
View benchmark-results.txt
$ 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
View watchr.rb
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')
View spec.rb
scenario "have ability to edit profile", :js => true do
@ability.should be_able_to(:edit, @profile)
end
View Gemfile
gem 'spork', '~> 0.9.0.rc'
You can’t perform that action at this time.