Skip to content

Instantly share code, notes, and snippets.

View kishorek's full-sized avatar

Kishore Kumar Uthirapathy kishorek

View GitHub Profile
@kishorek
kishorek / mermaid-viewer.html
Created October 14, 2025 17:06
View Mermaid files
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Mermaid Diagram Studio</title>
<script type="module">
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs';
mermaid.initialize({ startOnLoad: false, theme: 'default' });
window.mermaid = mermaid;
@kishorek
kishorek / record_full.js
Last active December 10, 2025 01:43
Record Tab Bookmarklet
javascript:(function(){if(window.__tabRecActive){alert('Tab Recorder is already running.');return;}window.__tabRecActive=true;var css='#tab-rec-ui{position:fixed;top:12px;right:12px;z-index:2147483647;background:rgba(17,17,17,.92);color:#fff;padding:10px 12px;border-radius:10px;font:13px/1.4 system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;box-shadow:0 6px 18px rgba(0,0,0,.35)}#tab-rec-ui button{background:#1f6feb;border:0;color:#fff;padding:6px 10px;border-radius:6px;cursor:pointer}#tab-rec-ui button[disabled]{opacity:.55;cursor:not-allowed}#tab-rec-ui .row{margin-top:6px}#tab-rec-ui .muted{opacity:.8;font-size:12px}';var style=document.createElement('style');style.textContent=css;document.head.appendChild(style);var ui=document.createElement('div');ui.id='tab-rec-ui';ui.innerHTML='<div style="font-weight:600;margin-bottom:6px">Tab Recorder</div><div class="row"><button id="tr-start">Start</button> <button id="tr-pause" disabled>Pause</button> <button id="tr-stop" disabled>Stop</button></di
@kishorek
kishorek / prompt.md
Created July 28, 2025 10:22
Reflection prompt

Please reflect on 5-7 different possible sources of the problem, distill those down to 1-2 most likely sources, and then add logs to validate your assumptions before we move onto implementing the actual code fix

@kishorek
kishorek / cursor.md
Last active July 28, 2025 10:20
Cursor Best Practices - Jul 2025

Cursor Best Practices

I’m using Cursor, so I’m wondering if I should go over best practices of using it first. This is to ensure as I work on my projects, I don’t get overwhelmed by complexity.


🔁 Before Using Cursor

  • Ask Claude to create a clear and detailed plan in Markdown:
  • Ask it to ask clarifying questions.
@kishorek
kishorek / main.py
Created August 2, 2024 05:58
Python cell block comment
#%%
print("This is a cell")
#%%
print("This is another cell")
@kishorek
kishorek / poetry_req.py
Created January 10, 2024 07:35
Export poetry dependencies as requirements.txt
def export_poetry_dependencies(pyproject_path, requirements_path):
# Flag to check if we are within the dependencies section
in_dependencies = False
with open(pyproject_path, "r") as pyproject_file, open(
requirements_path, "w"
) as requirements_file:
for line in pyproject_file:
# Check for the start of the dependencies section
if line.strip() == "[tool.poetry.dependencies]":
@kishorek
kishorek / gist:c2b0d28dc05ceb5d77cd11a49879108e
Created October 12, 2023 13:32
Mongo - Convert a string into number and use in a find query
{$expr:{$gt:[{$toInt:"$field"},1]}}
@kishorek
kishorek / gist:417aef863868ae3f15d325a3880437ad
Created October 12, 2023 13:24
Mongo - Get distinct values of a field
[
{
$unwind: {
path: '$field_name',
preserveNullAndEmptyArrays: true
}
},
{
$group: {
_id: null,
@kishorek
kishorek / db_utils.py
Created March 16, 2023 13:26
Elastic Search + Mongo in Python
from pymongo import MongoClient
from elasticsearch import Elasticsearch
class MongoElasticCache:
def __init__(self, mongo_uri, mongo_db, mongo_collection, es_host, es_index):
self.mongo_client = MongoClient(mongo_uri)
self.mongo_db = self.mongo_client[mongo_db]
self.mongo_collection = self.mongo_db[mongo_collection]
self.es_client = Elasticsearch([es_host])
@kishorek
kishorek / explore_json.py
Created February 15, 2022 05:25
Print all the keys in JSON
import json
"""
This script will print all the JSON keys present in a JSON
"""
FILE = "<file_path here>"
DIVIDER = "."
ARRAY_INDICATOR = "[]"