Skip to content

Instantly share code, notes, and snippets.

@saurabh2590
saurabh2590 / response.json
Created November 20, 2025 10:06
Atlas Index Recommendation Response
{
"clusterId": null,
"collectedIndexes": [
{
"accessCount": 219,
"index": [
{
"user_id": 1
},
{
-- Counting unique users who have atleast produced one event
SELECT
"system",
COUNT(DISTINCT user_id) AS nof_users
FROM "catalog-s3".bronze.mongodb.archiver.events
WHERE
"timestamp" >= '2024-08-01' AND
"timestamp" < '2025-08-01'
GROUP BY "system"
ORDER BY "system"
@saurabh2590
saurabh2590 / openpanel_script.html
Created November 7, 2025 10:54
Openpanel Integaration
<script>
window.op = window.op||function(...args){(window.op.q=window.op.q||[]).push(args);};
window.op('init', {
apiUrl: "https://events.bettermarks.com",
clientId: "999eae4d-c62d-45f0-8e3b-7d213a54d779",
trackScreenViews: true,
trackOutgoingLinks: true,
trackAttributes: true,
});
</script>
@saurabh2590
saurabh2590 / Things to put
Last active October 15, 2025 13:48
Mixpanel Integration Notes
<head>
......
<script>
(function (f, b) { if (!b.__SV) { var e, g, i, h; window.mixpanel = b; b._i = []; b.init = function (e, f, c) { function g(a, d) { var b = d.split("."); 2 == b.length && ((a = a[b[0]]), (d = b[1])); a[d] = function () { a.push([d].concat(Array.prototype.slice.call(arguments, 0))); }; } var a = b; "undefined" !== typeof c ? (a = b[c] = []) : (c = "mixpanel"); a.people = a.people || []; a.toString = function (a) { var d = "mixpanel"; "mixpanel" !== c && (d += "." + c); a || (d += " (stub)"); return d; }; a.people.toString = function () { return a.toString(1) + ".people (stub)"; }; i = "disable time_event track track_pageview track_links track_forms track_with_groups add_group set_group remove_group register register_once alias unregister identify name_tag set_config reset opt_in_tracking opt_out_tracking has_opted_in_tracking has_opted_out_tracking clear_opt_in_out_tracking start_batch_senders people.set people.set_once people.unset people.increment people.append people.union people.track
┌─────────┬────────────────────────────────────┬────────────────────┬─────────────────────┬─────────────┬─────────────────┬───────────────┬────────────┬─────────┬───────────┬────────────┐
│ (index) │ name │ namespace │ cpu │ memory │ type │ instanceCount │ memoryCost │ cpuCost │ totalCost │ perPodCost │
├─────────┼────────────────────────────────────┼────────────────────┼─────────────────────┼─────────────┼─────────────────┼───────────────┼────────────┼─────────┼───────────┼────────────┤
│ 0 │ 'calico-node' │ 'kube-system' │ 0.25 │ 0 │ 'V1DaemonSet' │ 10 │ 0 │ 36 │ '36.00' │ '3.60' │
│ 1 │ 'csi-ionoscloud' │ 'kube-system' │ 0 │ 0 │ 'V1DaemonSet' │ 10 │ 0 │ 0 │ '0.00' │ '0.00' │
│ 2 │ 'konnectivity-agent' │ 'kube-system' │ 0.016
@saurabh2590
saurabh2590 / Experiment.md
Last active March 7, 2024 09:01
Brainstorming ideas
@saurabh2590
saurabh2590 / experiment.md
Last active February 23, 2024 07:51
MongoDB experiment Request

Note:

  • This is something to consider and discuss if we should do it now or later, and I would love a healthy debate about the pros and cons of doing it now or later.

Context:

  • We are going to turn on reading and writing both from MongoDB.
  • I believe that it is going to increase the load on our MongoDB Atlas clusters
  • Increased load means we may be required to use the large cluster size.
  • The large size of the cluster means higher costs.
  • The experiment aims to validate if MongoDB is a cost-effective & performant event store for the long run.
@saurabh2590
saurabh2590 / generatePdf.ts
Created January 19, 2024 08:30
GeneratePDF for webpage
import * as puppeteer from 'puppeteer';
import * as fs from 'fs';
import * as readline from 'readline';
async function downloadWebpageAsPdf(url: string, outputFilePath: string): Promise<void> {
const browser = await puppeteer.launch();
const page = await browser.newPage();
try {
await page.goto(url, { waitUntil: 'networkidle2' });
#!/usr/bin/python3
# Author: Timotheus Pokorra <timotheus.pokorra@solidcharity.com>
# source hosted at https://github.com/SolidCharity/exportMediaWiki2HTML
# licensed under the MIT license
# Copyright 2020-2021 Timotheus Pokorra
import os
from urllib import parse
import requests
@saurabh2590
saurabh2590 / settings.md
Created December 5, 2023 14:16
Managing your custom settings