Skip to content

Patrick

writing, drawing, surfing, painting

Menu

All posts in python

Todo list in postgres (python)

Posted on June 8, 2025June 8, 2025Author theptrkPosted in postgresql, python

Timer in Terminal

Posted on June 19, 2024July 18, 2024Author theptrkPosted in python

main.py activate_terminal.scpt

openai embeddings in python with asyncio and gather

Posted on April 16, 2024May 24, 2024Author theptrkPosted in python

Async version: Sources

Django jupyter notebook in vscode

Posted on April 15, 2024April 15, 2024Author theptrkPosted in python

Django jupyter notebook in browser

Posted on April 15, 2024April 15, 2024Author theptrkPosted in python

How do you start a jupyter notebook with all the django settings working? Step 1: Install shell_plus from django-extensions Step 2: start shell_plus with –lab Note: old documentation may suggest “–notebook” Also:

Removing stopwords with NLTK

Posted on March 26, 2024March 26, 2024Author theptrkPosted in python

Code with explanations: Just the code

How to write files and read files in python

Posted on March 26, 2024March 27, 2024Author theptrkPosted in python

In short How would you optimize saving expensive API calls? Explanation Say you have a function with output you want to save. It could be from: Step: Create the directory you are saving to. I usually write to the system tmp directory or a project tmp tmp directory and put “tmp” in my gitignore so…

Read More

How to time a function in python (bonus: intervals ⏱️)

Posted on March 25, 2024March 25, 2024Author theptrkPosted in python

Method 1: use time.time() and do calculations Method 2: Create a Timer class that stores the start time and last time recorded

Chunking text

Posted on January 22, 2024February 3, 2024Author theptrkPosted in python

These are basic chunking utilities for quickly getting large text blocks into smaller chunks. Starts with Character based, then Word base, then Sentence based chunking.

async openai calls with python

Posted on January 4, 2024January 4, 2024Author theptrkPosted in python

In the previous post we explored asyncio (link), here we build on that to create async openai calls The uses the standard python “asyncio” library and the function asyncio.gather to concurrently call openai 3 times (you can add as many calls as you like).

Posts pagination

Page 1 Page 2 Next →
  • Coding (10)
  • Command line (5)
  • databases (7)
    • postgresql (7)
  • Deployment (1)
    • heroku (1)
  • Dev Environments (1)
  • docker (2)
  • Finance (1)
  • git (2)
  • Github (2)
    • pages (1)
  • Hello World (1)
  • htmx (1)
  • iOS (5)
    • autolayout (1)
    • Core Animation (1)
      • CAShapeLayer (1)
    • project setup (1)
  • Javascript (13)
    • Browser API (1)
    • chrome extension (1)
    • express (2)
  • Mac (7)
  • Machine Learning (10)
    • Arc Prize (1)
    • LLM (4)
  • Me Database (1)
  • Obsidian (1)
  • OpenAI (2)
  • python (20)
    • django (2)
  • Rust (1)
  • Server-Client (1)
  • Shopify (1)
  • Swift (1)
  • Uncategorized (18)
  • Unix (10)
  • vim (5)

©2025 Patrick | Theme by SuperbThemes.Com