TIL

Vim Tips

#vim

Some useful tips.

Read more →

April 6, 2025

Escape Keys using psycopg2

#python#psycopg2#postgresql

A mistake I seem to make repeatedly.

Read more →

April 6, 2025

Prune Docker Images

#docker#prune#image

How to remove the old images.

Read more →

April 6, 2025

Clear Highlighting in Vim

#vim

How to clear highlighting.

Read more →

April 6, 2025

Find and Replace in Vim

#vim#find#replace#substitute

How to do find and replace in Vim.

Read more →

April 6, 2025

MERGE Command with Examples

#postgresql#merge

How to use the merge command with PostgreSQL 15 and above.

Read more →

April 6, 2025

How to Create PowerShell Alias

#powershell#python#venv

Example of an alias with Python virtual environment.

Read more →

April 6, 2025

Self-Contained Python Scripts with uv

#uv#python#Tucker Beck#Dave Johnson

As long as uv is installed, be able to run a python script with dependencies.

Read more →

April 4, 2025

Data Spines

#sql#postgresql

A way to fill in data.

Read more →

April 1, 2025

Using Assert Never in Python

#assert_never#error#python

Similar to how to do it in SQL you can do in Python.

Read more →

April 1, 2025

Create Assert Function in SQL

#sql#assert never#error#Haki Benita

Using an assert to instead of sending NULL.

Read more →

April 1, 2025

Stub Code

#stub#beyond the basic stuff with python#python#Al Sweigart

A better way to have a new function that is not ready.

Read more →

March 31, 2025

List of Named Color for Pandas

#python#pandas

How to get a list of colors.

Read more →

March 29, 2025

How to Generate a list of Tables to Drop

#sql#pg_tables#drop_table#postgresql

An easy method to get a list of tables to remove.

Read more →

March 29, 2025

Passing a List of Arguments with Click

#click#python

This can be useful when an option can take multiples at the same time.

Read more →

March 29, 2025

Date Functions

#postgresql#date_part#to_char

Different ways to extract values of a date.

Read more →

March 29, 2025

Using DuckDB in Streamlit

#Petrica Leuca#duckdb#streamlit

There were a handful of useful things from this article.

Read more →

March 29, 2025

Random

#sql#postgresql#random#generate_series#ceil#array#Haki Benita

Some different ways to create random data

Read more →

March 29, 2025

Self Joins

#self joins#sql

How to do a self join.

Read more →

March 28, 2025

Recursive CTEs

#cte#sql#recursive

How to do a recursive CTE.

Read more →

March 28, 2025

Starting in Read Only Mode the Easy Way

#postgreslq#psql#Kaarel Moppel

Easy way to ensure that you are in read only mode.

Read more →

March 27, 2025

Postgres query cancellation

#postgresql#statement timeout

Couple of different ways to add a timeout to a PostgreSQL query.

Read more →

March 18, 2025

VS Code to Copy and Paste to Terminal

#Mehdi#vs code#duckdb#python#postgresql

Very useful tip from Mehdi without leaving your IDE

Read more →

March 10, 2025

Some New Unix/Linux Tools

#bash#bashrc#atuin

Shorten your .bashrc with newer Unix programs.

Read more →

February 22, 2025

Using uv to build and install Python CLI apps

#python#uv#cli#commandline interface#Rodrigo Girao Serrao

Not the full article but a couple of new items I did not know about.

Read more →

February 22, 2025

Generate CREATE TABLE query for an existing table

#postgresql#create table

When you do not have the script that created the table.

Read more →

February 22, 2025

The Reverse of cat is tac

#cat#tac#linux

tac is the reverse of cat.

Read more →

February 16, 2025

Browsing DuckdB Offline

#duckdb#documentation

When you want to be offline.

Read more →

February 14, 2025

Open Mateo Weather API

#open_mateo#python#weather#api

Open Mateo can be an alternative to Open Weather Map.

Read more →

February 1, 2025

Great Tables and StreamLit

#python#great_tables#streamlit

The Great Tables package is all about making it simple to produce nice-looking display tables.

Read more →

February 1, 2025

How to Reinstall Python with uv

#uv#python

uv python install –reinstall 3.13

Read more →

January 11, 2025

WAT Python Inspection Tool

#til#python#wat

A powerful inspection tool to help with unknown Python objects.

Read more →

January 1, 2025

RightTyper to Generate Types

#python#types#til

Get a helper with typing.

Read more →

December 31, 2024

Count Number of Lines in a Git Repository

#git#xargs#cat#wc#til

If you were ever curious how many lines of code you have in a repo.

Read more →

September 5, 2024

Check for unused Indexes

#til#postgresql#index

Part of a larger PostgreSQL management article.

Read more →

December 18, 2023

Powershell Remoting

#til#powershell#remote

A couple of different ways to connect to a remote PC.

Read more →

December 4, 2023

View Code of Stored Procedure

#til#ms sql server#ms sql server management studio#mssms

I needed to see the code of a stored procedure in MS SQL Server at work so that I could create a modified query. I normally don’t use Stack Overflow much anymore but this was actually useful and well described. Using SQL Server Management Studio do the following: Go to Database -> Programmmability -> Stored Procedure. Right click on the procedure you want to view and click Modify. Be careful not to modify it when you only want to view it.

Read more →

November 28, 2023

How to List Active Connections on PostgreSQL

#til#pg_stat_activity#postgresql

How to check using a query what is actively running.

Read more →

October 17, 2023

Check for Unvalidated Database Constraints

#til#postgresql#constraints#pg_constraint#mastodon

Verify that you don’t have a constraint created without validation.

Read more →

October 10, 2023

Deprecated

#til#python#deprecated

I neat way to deprecate parts of a Python program.

Read more →

September 19, 2023

How to Read a Vim Swapfile

#til#swapfile#vim

How to read a swapfile, especially where there isn’t an reference file.

Read more →

September 12, 2023

Get Battery Status in CLI

#til#linux#battery#cat#find

How to get the battery status using standard CLI tools in Linux.

Read more →

September 12, 2023

Delete Files Older Than x Days on Linux

#til#linux#find#rm#mtime

Quickly delete files older than a certain number of days.

Read more →

September 5, 2023

How to Use a match case Statement

#til#python 3.10#match case#python

Some examples of how to use match case statement in Python.

Read more →

August 29, 2023

Vim Tips

#til#vim#pybites

Notes from the VIM Workshop from pybites

Read more →

August 22, 2023

Create Git Branch and Checkout

#til#git#branch#checkout

Create a git branch and checkout at once.

Read more →

August 15, 2023

Set Statement Timeout

#til#timeout#statement_timeout#postgresql#idle_in_transaction

Set a timeout in case you want to terminate a long running query.

Read more →

August 1, 2023

Escape Keys using psycopg2

#til#psycopg2#python#postgresql

Making sure that using % in PostgreSQL works with psycopg2.

Read more →

June 2, 2023

Setup Python Package to use with Pipx

#til#python#pipx#pyproject#flit

Setting up your Python project to work with pipx and pyproject.toml

Read more →

May 26, 2023

Prune Docker Images

#til#docker#prune#images

Remove images that are not in use.

Read more →

April 21, 2023

Clear Highlighting in Vim

#til#vim#highlighting

Clearing highlighting after performing a search for an example.

Read more →

April 14, 2023

Find and Replace in Vim

#til#vim#find#replace#substitute

Different ways to find and replace items using vim.

Read more →

March 24, 2023

Include Schema in psycopg2 Connection String

#til#postgresql#psycopg2#sqlalchemy

Include schema in PostgreSQL connection string.

Read more →

December 19, 2022

Using Rich Inspect to Interrogate Python Objects

#til#python#rich#inspect

Using Rich can help format an object in the REPL.

Read more →

November 13, 2022