Skip to content

Instantly share code, notes, and snippets.

View sanjeed5's full-sized avatar

Sanjeed sanjeed5

View GitHub Profile
@sanjeed5
sanjeed5 / download_kaggle_to_collab
Last active August 16, 2021 08:19
How to download competition dataset from Kaggle to Google Collab easily and unzip
# Copy paste this gist in a Google Collab cell
# Go to your Kaggle competition page -> data, scroll below to see the kaggle api command which looks similar to below line
# !kaggle competitions download -c competitive-data-science-predict-future-sales -p data
# Replace that line accordingly in the below code
# Run the cell
!pip install kaggle
from google.colab import files
files.upload()
@sanjeed5
sanjeed5 / netaccess.py
Last active August 31, 2021 01:17 — forked from cooliscool/netaccess.py
Approve Netaccess automatically ( for IIT Madras ).
#!/usr/bin/env python
import requests
import sys
import getpass
username = input('Enter username: ')
pa = str(getpass.getpass(prompt='Enter password: '))
with requests.session() as s:
try:
page = s.post('https://netaccess.iitm.ac.in/account/login' , data={ 'userLogin':username, 'userPassword':pa, 'submit':''}, verify=False)
// ==UserScript==
// @name Mangasee123 Fast Scroll
// @namespace http://tampermonkey.net/
// @version 0.2
// @description Simulate Option + Down arrow when I just press down arrow on mangasee123.com with smooth scrolling.
// @author You
// @match https://mangasee123.com/*
// @grant none
// ==/UserScript==
// ==UserScript==
// @name Mangasee123 Auto Scroll
// @namespace http://tampermonkey.net/
// @version 0.7
// @description Auto scroll on mangasee123.com with smooth scrolling, toggle key, and notifications. Defaults are for 67% zoomed mangasee.
// @author You
// @match https://mangasee123.com/*
// @grant none
// ==/UserScript==
@sanjeed5
sanjeed5 / QWERTY no option.keylayout
Created November 28, 2024 23:46 — forked from greneholt/QWERTY no option.keylayout
Mac QWERTY keyboard layout without bindings for the option key. This disables the annoying default behavior of key combinations like option+i that enters diacritic mode and prevents using such shortcuts in VS Code.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE keyboard SYSTEM "file://localhost/System/Library/DTDs/KeyboardLayout.dtd">
<keyboard group="0" id="5000" name="QWERTY no option" maxout="1">
<layouts>
<layout first="0" last="0" modifiers="48" mapSet="312" />
</layouts>
<modifierMap id="48" defaultIndex="0">
<keyMapSelect mapIndex="0">
<modifier keys="" />
</keyMapSelect>
@sanjeed5
sanjeed5 / mcp.json
Created March 17, 2025 08:08
My MCP setup for Cursor
{
"mcpServers": {
"Google Docs": {
"url": "https://mcp.composio.dev/googledocs/REDACTED"
},
"Slack": {
"url": "https://mcp.composio.dev/slack/REDACTED"
},
"fetch": {
"command": "uvx",
@sanjeed5
sanjeed5 / deploy-env-to-cloudflare.sh
Created March 22, 2025 16:30
Upload all .env to Cloudflare Pages with one script
#!/bin/bash
# Script to automatically upload all environment variables from .env to Cloudflare Pages
echo "Uploading environment variables to Cloudflare Pages project:"
# Read each non-comment line from the .env file
while IFS= read -r line || [[ -n "$line" ]]; do
# Skip empty lines or comments
if [[ -z "$line" || "$line" == \#* ]]; then
{
"questions": [
{
"type": "guesstimate",
"role": "APM",
"difficulty": "medium",
"text": "Could you estimate the number of burgers a McDonald's outlet sells in a day?",
"context": "This is an average McDonald's outlet, not in a specific location like an airport. Only considering in-restaurant purchases.",
"referenceAnswer": "To estimate the number of burgers a McDonald's outlet sells in a day, I'll use a structured approach:\n\n1. Restaurant capacity: An average McDonald's has about 50 seats\n2. Operating hours: Typically open from 10 am to 10 pm (12 hours)\n3. Peak vs. non-peak consumption patterns:\n - Peak hours (12-2pm, 6-8pm): 80-90% occupancy\n - Regular hours: 30-40% occupancy\n4. Average meal time: 20-30 minutes\n5. Burger consumption: About 70% of customers order a burger\n\nCalculation:\n- Peak hours (4 hours): 50 seats × 0.85 occupancy × (4 hours × 60 min / 25 min per customer) × 0.7 burger rate ≈ 714 burgers\n- Regular hours (8 hours): 50 seats × 0.35
@sanjeed5
sanjeed5 / langgraph_uv_guide.md
Created April 3, 2025 10:30
This is a concise guide on setting up and running the LangGraph development server (`langgraph dev`) using `uv` as the package manager and runner.

Running LangGraph Dev with UV

This is a concise guide on setting up and running the LangGraph development server (langgraph dev) using uv as the package manager and runner.

Prerequisites

  1. Python: Ensure you have Python 3.11+ installed.
  2. UV: Install uv: curl -LsSf https://astral.sh/uv/install.sh | sh (or other methods from astral.sh/uv).
  3. .env file: Have your necessary API keys (e.g., OPENAI_API_KEY) in a .env file in your project root.
  4. LangGraph Agent: Have your LangGraph agent code (e.g., in agent.py) defining a compiled graph (e.g., graph).
import argparse
import json
import os
import sys
def jsonl_to_json(jsonl_file_path: str, json_file_path: str):
"""
Converts a JSONL file to a JSON file.
Args: