Skip to content

Instantly share code, notes, and snippets.

View RayBenefield's full-sized avatar

Ray Benefield RayBenefield

View GitHub Profile

Please include a repro

You probably arrived here because of a curt message in response to an issue you filed on a repo that I contribute to. Sorry about that (particularly if you filed the issue long ago and have been waiting patiently for a response). Let me explain:

I work on a lot of different open source projects. I really do like building software that makes other people's lives easier, but it's crazy time-consuming. One of the most time-consuming parts is responding to issues. A lot of OSS maintainers will bend over backwards to try and understand your specific problem and diagnose it, to the point of setting up new test projects, fussing around with different Node versions, reading the documentation for build tools that we don't use, debugging problems in third party dependencies that appear to be involved in the problem... and so on. I've personally spent hundreds of hours of my free time doing these sorts of things to try and help people out, because I want to be a responsible maintainer and I

@RayBenefield
RayBenefield / generate-pushid.js
Created December 6, 2017 22:29 — forked from mikelehen/generate-pushid.js
JavaScript code for generating Firebase Push IDs
/**
* Fancy ID generator that creates 20-character string identifiers with the following properties:
*
* 1. They're based on timestamp so that they sort *after* any existing ids.
* 2. They contain 72-bits of random data after the timestamp so that IDs won't collide with other clients' IDs.
* 3. They sort *lexicographically* (so the timestamp is converted to characters that will sort properly).
* 4. They're monotonically increasing. Even if you generate more than one in the same timestamp, the
* latter ones will sort after the former ones. We do this by using the previous random bits
* but "incrementing" them by 1 (only in the case of a timestamp collision).
*/
@RayBenefield
RayBenefield / event-sourcing-dynamodb.md
Last active December 1, 2017 19:48
Replayable ‘transactions’ with event sourcing on DynamoDB

Original Article: https://www.atlassian.com/blog/archives/replayable-transactions-event-sourcing-dynamodb

Replayable ‘transactions’ with event sourcing on DynamoDB

In the Engineering Services team at Atlassian, we’re busily building out a microservice-based architecture for our applications. This is a massive change for us, and it is imperative that our changes are ’safe’, i.e. we prove as much as possible that we cannot inadvertently destroy data, and we can recover from any data issues that we do encounter. This led us to implement an event sourcing

@RayBenefield
RayBenefield / api-creation.md
Last active April 20, 2017 20:06
Simple iterative steps to create an API server in Node

Did you know?

APIs run the same core system as Websites. Websites are just an HTTP call with the GET verb with a content-type of "text/html" this tells the caller that it can be rendered as HTML. Browsers know how to render HTML nicely and that's what you see in a website.

Try making a call to Postman without a server running.

postman - http://localhost:8000 (no response)

Make a project directory:

<?php
class car {
// class-level variables storing classes; Type-hinted
protected $Frame;
protected $Paint;
protected $Tires;
// class-level variables; not Type-hinted
protected $paintColor = 'red'; // class-level variable storing a scalar