Skip to content

Instantly share code, notes, and snippets.

View xshapira's full-sized avatar

Max Shapira xshapira

View GitHub Profile
@xshapira
xshapira / cursor-agent-system-prompt.txt
Created May 19, 2025 18:13 — forked from sshh12/cursor-agent-system-prompt.txt
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.
@xshapira
xshapira / download_files_from_googledrive.py
Created December 19, 2024 10:22 — forked from swyoon/download_files_from_googledrive.py
A script for downloading all files in a Google Drive folder.
"""
A Python script for downloading all files under a folder in Google Drive.
Downloaded files will be saved at the current working directory.
This script uses the official Google Drive API (https://developers.google.com/drive).
As the examples in the official doc are not very clear to me,
so I thought sharing this script would be helpful for someone.
To use this script, you should first follow the instruction
in Quickstart section in the official doc (https://developers.google.com/drive/api/v3/quickstart/python):
@xshapira
xshapira / brew-bundle-brewfile-tips.md
Created September 22, 2024 16:32 — forked from ChristopherA/brew-bundle-brewfile-tips.md
Brew Bundle Brewfile Tips

Brew Bundle Brewfile Tips

Copyright & License

Unless otherwise noted (either in this file or in a file's copyright section) the contents of this gist are Copyright ©️2020 by Christopher Allen, and are shared under spdx:Creative Commons Attribution Share Alike 4.0 International (CC-BY-SA-4.) open-source license.

Sponsor

If you more tips and advice like these, you can become a monthly patron on my GitHub Sponsor Page for as little as $5 a month; and your contributions will be multipled, as GitHub is matching the first $5,000! This gist is all about Homebrew, so if you like it you can support it by donating to them or becoming one of their Github Sponsors.

@xshapira
xshapira / index.html
Created September 19, 2024 07:17
Aweber click tracking
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Redirecting...</title>
<link rel="stylesheet" href="styles.css">
<script type="text/javascript" defer src="https://analytics.aweber.com/js/awt_analytics.js?id=1OYQT"></script>
</head>
<body>
@xshapira
xshapira / main.py
Last active September 19, 2024 06:13
cloaker api
import logging
import requests
from fastapi import FastAPI, Request
from fastapi.middleware.cors import CORSMiddleware
from fastapi.middleware.gzip import GZipMiddleware
from fastapi.responses import HTMLResponse, RedirectResponse
from fastapi.staticfiles import StaticFiles
from fastapi.templating import Jinja2Templates
@xshapira
xshapira / gpg-safe.sh
Last active June 9, 2024 07:48 — forked from wbotelhos/gpg-safe.sh
gpg: WARNING: unsafe permissions on homedir '~/.gnupg'
# Make sure that the .gnupg directory and its contents is accessibile by your user.
chown -R $(whoami) ~/.gnupg/
# If not, run this:
sudo chown -R $USER ~/.gnupg
# Then give the right permissions:
sudo chmod 700 ~/.gnupg
sudo chmod 600 ~/.gnupg/*

Homebrew: How to Backup & Restore Homebrew Packages

Homebrew makes it easy to install and keep installed software up to date on your Mac - as part of my backup routine for my Mac I want to be able to run a single command to reinstall all packages.

If you're searching on how to backup & restore Homebrew, then I assume you're here for the commands.

Brewfiles

Brewfiles are files generated with definitions that Homebrew reads and processes, a generated

@xshapira
xshapira / poetry-convert.py
Created May 6, 2024 06:18 — forked from tigerhawkvok/poetry-convert.py
Convert a requirements.txt file to a Poetry project
#!python3
"""
Convert a requirements.txt file to a Poetry project.
Just place in the root of your working directory and run!
"""
sourceFile = "./requirements.txt"
import re
import os
@xshapira
xshapira / CHRUBY_add_ruby_version.md
Created December 8, 2023 00:51 — forked from yannvery/CHRUBY_add_ruby_version.md
CHRUBY - How to install a new ruby version

Install a new ruby version with chruby

OSX

First of all you must update ruby-build to update definitions list.

brew update

And update ruby-build

@xshapira
xshapira / settings.py
Created February 25, 2023 08:59
Django 4.1+ -- fix HTML templates not being updated in development.
# Starting with Django 4.1+ we need to pick which template loaders to use
# based on our environment since 4.1+ will cache templates by default.
default_loaders = [
"django.template.loaders.filesystem.Loader",
"django.template.loaders.app_directories.Loader",
]
cached_loaders = [("django.template.loaders.cached.Loader", default_loaders)]