Skip to content

Instantly share code, notes, and snippets.

View m-x-k's full-sized avatar

Martin Kelly m-x-k

View GitHub Profile
@niksumeiko
niksumeiko / git.migrate
Last active November 10, 2024 18:26
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
@staltz
staltz / introrx.md
Last active November 17, 2024 01:08
The introduction to Reactive Programming you've been missing
@CMCDragonkai
CMCDragonkai / http_streaming.md
Last active October 24, 2024 17:43
HTTP Streaming (or Chunked vs Store & Forward)

HTTP Streaming (or Chunked vs Store & Forward)

The standard way of understanding the HTTP protocol is via the request reply pattern. Each HTTP transaction consists of a finitely bounded HTTP request and a finitely bounded HTTP response.

However it's also possible for both parts of an HTTP 1.1 transaction to stream their possibly infinitely bounded data. The advantages is that the sender can send data that is beyond the sender's memory limit, and the receiver can act on

@tomazzaman
tomazzaman / README.md
Last active April 19, 2024 17:01
Kill supervisor on Docker when any of the services fail

Killing supervisor if any of it's child processes fail

The trick is to only register the listener for events that indicate failure, namely

  • PROCESS_STATE_STOPPED
  • PROCESS_STATE_EXITED
  • PROCESS_STATE_FATAL

Once they do, we should send a SIGQUIT to Supervisor.

@latesr
latesr / s3replica-stack.ts
Last active June 16, 2020 14:31
AWS cdk for V1 bucket replication that propagates soft deletes
//References:
//For permissions required for replication:
// https://docs.aws.amazon.com/AmazonS3/latest/dev/setting-repl-config-perm-overview.html
//To understand delete propagation and the differences between V1 and V2 replication:
// https://aws.amazon.com/blogs/storage/managing-delete-marker-replication-in-amazon-s3/
//
//Summary:
//This creates:
// 1) Two private buckets (archive and replica)
// 2) A role with a policy supporting replication from archive to replica