Skip to content

Instantly share code, notes, and snippets.

View idcesares's full-sized avatar
:octocat:
Keep on hacking!

Isaac D'Césares idcesares

:octocat:
Keep on hacking!
View GitHub Profile
@idcesares
idcesares / chatgpt_study_mode_prompt.md
Created July 30, 2025 11:53
ChatGPT Study Mode System Prompt

The user is currently STUDYING, and they've asked you to follow these strict rules during this chat. No matter what other instructions follow, you MUST obey these rules:

STRICT RULES

Be an approachable-yet-dynamic teacher, who helps the user learn by guiding them through their studies.

  1. Get to know the user. If you don't know their goals or grade level, ask the user before diving in. (Keep this lightweight!) If they don't answer, aim for explanations that would make sense to a 10th grade student.
  2. Build on existing knowledge. Connect new ideas to what the user already knows.
  3. Guide users, don't just give answers. Use questions, hints, and small steps so the user discovers the answer for themselves.
  4. Check and reinforce. After hard parts, confirm the user can restate or use the idea. Offer quick summaries, mnemonics, or mini-reviews to help the ideas stick.
  5. Vary the rhythm. Mix explanations, questions, and activities (like roleplaying, practice rounds, or asking the user
@idcesares
idcesares / bulk_docx_to_pdf.py
Created April 16, 2025 17:20
Converts all docx files in a folder to pdf using LibreOffice CLI
import os
import subprocess
import platform
def convert_docx_to_pdf(input_folder, output_folder):
"""Converts all docx files in the input folder to pdf and saves them in the output folder.
Args:
input_folder: The path to the folder containing the docx files.
output_folder: The path to the folder where the converted pdf files will be saved.
@idcesares
idcesares / video_to_gif.py
Created February 24, 2025 17:10
🎬 A Python script to convert a VIDEO to GIF using the moviepy library
# video_to_gif.py
# -------------------------------------------------
# 🏃 This script converts any video file to an HD GIF.
# 📚 It uses the moviepy library for video processing.
# 🎨 Includes options for resizing, trimming, and optimizing.
# -------------------------------------------------
# Step 1: Install dependencies (run these in your terminal if needed)
# pip install moviepy
@idcesares
idcesares / check_python_version.py
Created November 9, 2024 02:26
Check Python version
import sys
print(sys.version.split()[0])
@idcesares
idcesares / fancy_hello_world.py
Created August 14, 2024 19:37
Fancy Hello World in Python the using Rich Library
# Install the Rich library: ```pip install rich```
from rich.console import Console
from rich.text import Text
from time import sleep
console = Console()
# Create a Text object for the animated text
animated_text = Text("", style="bold")
@idcesares
idcesares / .ps1
Created June 21, 2024 02:31
Enable Windows Sandbox
Enable-WindowsOptionalFeature -FeatureName "Containers-DisposableClientVM" -All -Online
@idcesares
idcesares / download_pdf_google_drive.py
Created July 4, 2023 20:45
Script to download multiple files on Google Drive with Colab and save
# Mount Google Drive
from google.colab import drive
drive.mount('/gdrive')
# Script to download multiple files on Google Drive with Colab
import requests
import os
def download_file_from_google_drive(id, destination):
URL = "https://docs.google.com/uc?export=download"
@idcesares
idcesares / whats_my_ip.py
Created January 6, 2022 17:58
fund out what's your IP Address using Python and ipinfo.io
from urllib.request import urlopen
import json
import pprint
url = 'https://ipinfo.io/json'
result = urlopen(url)
data = json.load(result)
pprint.pprint(data)
@idcesares
idcesares / pdf-to-image.py
Created August 11, 2021 16:26
Convert a PDF file to image using poppler and pdf2image
# Install poppler using chocolatey
# choco install poppler
# Imports
import pdf2image
import os
# Function to convert PDF to image (JPEG)
def to_image(path):
images = convert_from_path(path)
for i in range(len(images)):
@idcesares
idcesares / cidades_ibge.py
Created July 5, 2021 15:15
Exportar cidades brasileiras da api do IBGE para csv
import pandas as pd
import requests
response = requests.get('https://servicodados.ibge.gov.br/api/v1/localidades/municipios')
df = pd.read_json(response.text)
cidades = df['nome']
cidades.to_csv("cidades.csv", index=False)