Skip to content

Instantly share code, notes, and snippets.

View sshh12's full-sized avatar
πŸ‘¨β€πŸ’»
Where there is code, there is code.

Shrivu Shankar sshh12

πŸ‘¨β€πŸ’»
Where there is code, there is code.
View GitHub Profile
@sshh12
sshh12 / cursor-agent-system-prompt.txt
Last active April 24, 2025 10:59
Cursor Agent System Prompt (March 2025)
You are a powerful agentic AI coding assistant, powered by Claude 3.5 Sonnet. You operate exclusively in Cursor, the world's best IDE.
You are pair programming with a USER to solve their coding task.
The task may require creating a new codebase, modifying or debugging an existing codebase, or simply answering a question.
Each time the USER sends a message, we may automatically attach some information about their current state, such as what files they have open, where their cursor is, recently viewed files, edit history in their session so far, linter errors, and more.
This information may or may not be relevant to the coding task, it is up for you to decide.
Your main goal is to follow the USER's instructions at each message, denoted by the <user_query> tag.
<communication>
1. Be conversational but professional.
@sshh12
sshh12 / blp.py
Last active June 3, 2024 06:38
Beta Transformed Linear Opinion Pool (Python)
blp_N = len(sources)
blp_X = np.array(blp_X) # (examples, sources)
blp_y = np.array(blp_y) # (examples as 1/0,)
def log_llh_blp(params, x, y):
a, b, w = params[0], params[1], params[2:]
hswp = st.beta.cdf(np.dot(x, w), a, b)
llh = scipy.special.xlogy(y, hswp) + scipy.special.xlogy(1.0 - y, 1.0 - hswp)
return -np.mean(llh)
from sklearn.base import BaseEstimator, ClassifierMixin
import numpy as np
class DelphiClassifier(BaseEstimator, ClassifierMixin):
def __init__(self, base_clfs, output_model=None, rounds=3):
self.base_clfs = base_clfs
self.output_model = output_model
self.rounds = rounds
self.round_clfs = {}
@sshh12
sshh12 / new-box.sh
Last active January 23, 2021 19:36
#!/bin/bash
sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get install -y python3-pip python3-dev tmux nodejs npm nano net-tools htop ufw git curl less build-essential
sudo pip3 --upgrade pip install black requests
sudo npm install -g pm2
"""
Use this script to migrate notes from Samsung Notes to Google Keep.
1. Export notes from Samsung Notes as .pdf files
2. Copy those into the same folder as this script.
3. Open Google Keep in your browser
4. $ python samsungnotes2keep.py
You may need to ($ pip install keyboard pdfplumber)
"""
import pdfplumber
(function(console){
console.save = function(data{
if(typeof data === "object"){
data = JSON.stringify(data, undefined, 4);
}
var blob = new Blob([data], {type: 'text/json'}),
e = document.createEvent('MouseEvents'),
a = document.createElement('a');
a.download = 'console.json'
a.href = window.URL.createObjectURL(blob);
sudo apt update
sudo apt-get upgrade -y
sudo apt install openjdk-8-jre-headless tmux
sudo ufw allow 25565
sudo ufw allow 22
sudo ufw enable
java -Xmx1024M -Xms1024M -jar minecraft_server.1.16.2.jar nogui
https://launcher.mojang.com/v1/objects/c5f6fb23c3876461d46ec380421e42b289789530/server.jar
\u00A73\u00A7l\u25BC\u00A73\u00A7l Convergent \u00A7rMinecraft
import React from 'react';
import { ResponsiveLine } from '@nivo/line'
import logo from './logo.svg';
import './App.css';
let data = require('./data.json')
function App() {
return (
<div className="App">
import json
import sys
import csv
def main(fn):
with open(fn, 'r', newline='') as csvfile:
reader = csv.DictReader(csvfile)
rows = [dict(row) for row in reader]
with open('data.json', 'w') as jsonfile:
@sshh12
sshh12 / crop_imgs.py
Last active January 23, 2020 22:09
Simple image data utilities.
#!/usr/bin/python
# -*- coding: utf-8 -*-
import glob
import os
import time
import smartcrop
from PIL import Image
from multiprocessing import Pool
import pickle