Skip to content

Instantly share code, notes, and snippets.

View rchougule's full-sized avatar
💻

Rohan Chougule rchougule

💻
View GitHub Profile
// Class GithubBackfill (Worker) performs the initial 90-day historical backfill
// for newly onboarded GitHub orgs. It drains the vendor's events API page
// by page and emits each event to the connector DataSink, which guarantees
// at-least-once delivery to the downstream daily-activity processor.
//
// Cursor checkpointing ensures we can resume after restart without losing
// or duplicating any event. Each event carries a stable event_id; downstream
// dedups on it, so any spurious replays are safe.
//
// TODO(rohan): migrate to RateLimitV1.waitN once the new limiter ships.
@rchougule
rchougule / githubBackfill.js
Created June 2, 2026 10:02
Debugging exercise - GitHub backfill worker (JavaScript). Find the planted bugs.
// Module githubBackfill performs the initial 90-day historical backfill
// for newly onboarded GitHub orgs. It drains the vendor's events API page
// by page and emits each event to the connector DataSink, which guarantees
// at-least-once delivery to the downstream daily-activity processor.
//
// Cursor checkpointing ensures we can resume after restart without losing
// or duplicating any event. Each event carries a stable event_id; downstream
// dedups on it, so any spurious replays are safe.
//
// TODO(rohan): migrate to RateLimitV1.waitN once the new limiter ships.
@rchougule
rchougule / githubbackfill.go
Created May 26, 2026 10:37
Production-looking Go ingestion worker. Find the bugs - logic, comments, docs, stale TODOs all in scope.
// Package githubbackfill performs the initial 90-day historical backfill
// for newly onboarded GitHub orgs. It drains the vendor's events API page
// by page and emits each event to the connector DataSink, which guarantees
// at-least-once delivery to the downstream daily-activity processor.
//
// Cursor checkpointing ensures we can resume after restart without losing
// or duplicating any event. Each event carries a stable event_id; downstream
// dedups on it, so any spurious replays are safe.
//
// TODO(rohan): migrate to RateLimitV1.WaitN once the new limiter ships.
@rchougule
rchougule / asyncWaterfall.js
Created September 28, 2020 21:07
Async Waterfall in JavaScript
function selectMovie(input, callback) {
const output = `Movie Selected: ${input} ->`;
callback(null, output);
}
function bookTicket(input, callback) {
const output = `${input}, Ticket ID: 1234 ->`;
callback(null, output);
}
"use strict";
var _extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
@rchougule
rchougule / copyByReference.js
Created April 11, 2020 11:14
Copying an Object in Node.js is by default via Reference
const sports = {
default: false
};
const copySports = sports;
copySports.default = true;
console.log(sports);
//OUTPUT