Navigation Menu

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 / publish-with-idempotency-for-retries.js
Created April 18, 2019 11:35
Ably Idempotency for automatic retries by our SDKs
var rest = new Ably.Rest(key: ablyApiKey, idempotentRestPublishing: true);
var channel = rest.channels.get('example-channel');
channel.publish([{ data: 'payload' }]);
@mattheworiordan
mattheworiordan / publish-with-client-supplied-id.js
Last active April 18, 2019 11:35
Ably Idempotency with client supplied message ID
var rest = new Ably.Rest(ablyApiKey);
var channel = rest.channels.get('example-channel');
channel.publish([{ data: 'payload', id: 'unique123' }]);
@mattheworiordan
mattheworiordan / corporate-cla.txt
Created June 18, 2018 08:57 — forked from open-sdsp-leader/corporate-cla.txt
Individual and Corporate CLA
Thank you for your interest in Open SDSP (the
"Open Specification") and Ably Real-time Ltd (the "Project Sponsor").
In order to clarify the intellectual property license granted with
Contributions from any person or entity, the Project Sponsor
must have a Contributor License Agreement (CLA) on file that has been
signed by each Contributor, indicating agreement to the license terms
below. This license is for your protection as a Contributor as well
as the protection of the Project Sponsor and its users; it does not
change your rights to use your own Contributions for any other purpose.
@mattheworiordan
mattheworiordan / offer.md
Last active November 26, 2018 14:47
Recommend a distributed system engineer we employ and earn yourself $3,000

Unfortunately we're finding it really hard to find good distributed systems engineers at Ably, a distributed realtime data delivery platform.

We know a lot of you out there probably know great people who love solving truly hard distributed problems with a distributed team of superb engineers.

If you know anyone who fits the bill, wants to work remotely and is based in Europe (or wants to work on-site in London), we'll give you $3,000 simply for the referral if we end up employing them.

Follow these steps to earn $3,000 for one minute of your time:

  1. Contact the people you think are suitable for our Distributed Systems Engineer role and tell them to apply on that page
  2. Email us at engineer-referral@ably.io with the name or
@mattheworiordan
mattheworiordan / restart.sh
Created August 19, 2017 13:23
Heroku scheduled restarts
#!/bin/sh
# Set up the Heroku scheduler to run this command every hour. See example setup at https://goo.gl/nMCSH3
#
# Requires env vars to be set in Heroku with `heroku config:set`:
# - HEROKU_APP_NAME: this is just the app name in Heroku, i.e. `heroku apps` will list all apps you have access to
# - HEROKU_CLI_USER: Once Heroku CLI is authenticated (https://goo.gl/Qypr4x), check `cat .netrc` (or `_netrc` on Windows),
# look for `login` under `machine api.heroku.com`
# - HEROKU_CLI_TOKEN: As above, but use the `password` field
#
@mattheworiordan
mattheworiordan / consume-bunny.rb
Created February 3, 2017 04:23
Consume Reactor Queues from Ruby
require "bunny"
require "json"
require "securerandom"
QUEUE = "appId:queue"
VHOST = 'shared'
def consume
consumer_conn = Bunny.new(
hostname: "us-east-1-a-queue.ably.io",
@mattheworiordan
mattheworiordan / rabbitmqadmin.py
Created February 1, 2017 00:40
Rabbit MQ admin tool
#!/usr/bin/env python
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (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.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
# License for the specific language governing rights and limitations
Europe - Andorra
Asia - Dubai
Asia - Kabul
America - Antigua
America - Anguilla
Europe - Tirane
Asia - Yerevan
Africa - Luanda
Antarctica - McMurdo
Antarctica - Casey
@mattheworiordan
mattheworiordan / channel-attach-example.js
Last active July 12, 2016 14:09
v0.8 channel attach example
function reattach(channel) {
channel.attach();
/* Example when using presence on the channel */
channel.presence.enter();
}
/* Connection state changes can trigger channels to become detached
Automatically re-attach channels, nothing will happen if already attached */
client.connection.on('connected', function() {
for (let channelName in client.channels.all) {
@mattheworiordan
mattheworiordan / messages.js
Last active March 25, 2016 21:21
actioncable messages
/* Published message from client following a call to @perform, see https://goo.gl/s3Hb9G */
{"command":"message","identifier":"{\"channel\":\"EventsChannel\"}","data":"{\"action\":\"request_count\"}"}
/* Published message from client following a call to @perform, see https://goo.gl/s3Hb9G */
{count: "2", broadcastAt: 1458940410054.843}
/* No ACK/NACK for the published message, how do you know it arrived? */