Skip to content

Instantly share code, notes, and snippets.

View gniting's full-sized avatar
🐢

Nitin Gupta gniting

🐢
View GitHub Profile
@gniting
gniting / mongo_prune_js.js
Created August 12, 2025 08:03 — forked from arevindh/mongo_prune_js.js
mongo_prune_js.js
// keep N-day worth of data
var days=7;
// change to false to have the script to really exclude old records
// from the database. While true, no change at all will be made to the DB
var dryrun=true;
var now = new Date().getTime(),
time_criteria = now ;
time_criteria_in_seconds = time_criteria / 1000;
@gniting
gniting / BTT Trigger
Created December 15, 2024 10:06
BTT keyboard shortcut trigger for starting a temp chat with the MacOS ChatGPT app
[
{
"BTTActionCategory" : 0,
"BTTLastUpdatedAt" : 1734256490.1134801,
"BTTTriggerType" : 0,
"BTTTriggerClass" : "BTTTriggerTypeKeyboardShortcut",
"BTTUUID" : "E7DA8FC7-2470-4A3C-97FA-88BED661D2CF",
"BTTPredefinedActionType" : 366,
"BTTPredefinedActionName" : "Empty Placeholder",
"BTTAdditionalConfiguration" : "1835049",
@gniting
gniting / mtr_test.py
Last active January 24, 2024 22:29
Help ControlD team
import subprocess
def run_command(command):
return subprocess.run(command, capture_output=True, text=True).stdout
def ping_host(host):
return run_command(['ping', '-c', '5', host])
def run_mtr(host):
return run_command(['mtr', '-4', '-z', '-r', '-c', '5', host])

Keybase proof

I hereby claim:

  • I am gniting on github.
  • I am nitin (https://keybase.io/nitin) on keybase.
  • I have a public key ASDKmW6MpT-w8MLdwF44r8mfUNndJa1_98FlieLQLXzmhAo

To claim this, I am signing this object: