Skip to content

Instantly share code, notes, and snippets.

View Sanyambansal76's full-sized avatar
🎯
Focusing

Sanyam Bansal Sanyambansal76

🎯
Focusing
View GitHub Profile
@Sanyambansal76
Sanyambansal76 / CursorTools.json
Created March 6, 2025 16:36 — forked from ScriptedAlchemy/CursorTools.json
Reverse Engineering cursor prompts
{
"tools": [
{
"type": "function",
"function": {
"name": "codebase_search",
"description": "Find snippets of code from the codebase most relevant to the search query.\nThis is a semantic search tool, so the query should ask for something semantically matching what is needed.\nIf it makes sense to only search in particular directories, please specify them in the target_directories field.\nUnless there is a clear reason to use your own search query, please just reuse the user's exact query with their wording.\nTheir exact wording/phrasing can often be helpful for the semantic search query. Keeping the same exact question format can also be helpful.",
"parameters": {
"type": "object",
"properties": {
@Sanyambansal76
Sanyambansal76 / local_settings.py
Created October 8, 2018 13:51 — forked from rochacbruno/local_settings.py
Django Profiling Middleware with hotshot or Cprofile
MIDDLEWARE_CLASSES = MIDDLEWARE_CLASSES + (
'yourapp.middleware.ProfileMiddleware',
'yourapp.middleware.CProfileMiddleware'
)
@Sanyambansal76
Sanyambansal76 / sql_replace_in_django_orm.py
Created May 1, 2018 10:17 — forked from simonw/sql_replace_in_django_orm.py
How to use the SQL replace function in a Django ORM query
from django.db.models import F, Func, Value
from myapp.models import MyModel
# Annotation
MyModel.objects.filter(description__icontains='\r\n').annotate(
fixed_description=Func(
F('description'),
Value('\r\n'), Value('\n'),
function='replace',
)