Notes on Pelican hosting with GitHub Pages

Wed 25 December 2024 — Filed under python; tags: python

I've set up several Pelican sites on GitHub Pages and each time I seem to run into way more trouble than seems necessary. Here are a few details that I seem to need to rediscover each time.

Add themes as git submodules

For example, to use Flex:

git submodule add https://github.com/alexandrevicenzi/Flex.git Flex
git commit -am "Added Flex submodule"
git push origin main

Use nelsonjchen/gh-pages-pelican-action


Python on an Arduino Nano RP2040 Connect

Sat 10 June 2023 — Filed under projects; tags: python, arduino read more

I recently purchased an Arduino Nano RP2040 Connect with the hope of running MicroPython (one of the useful side effects of having kids is an excuse to buy stuff for projects). It's worth noting a couple of the issues that …

sqlite dict factory

Tue 10 June 2014 — Filed under notes; tags: python, sqlite read more

Probably not as efficient as using the sqlite3.Row class, but works when actual dict objects are required. Adapted from https://docs.python.org/2/library/sqlite3.html.

import sqlite3

def dict_factory(cursor, row):
    return {col[0]: row[idx] for idx, col in enumerate(cursor.description)}

con = sqlite3.connect(":memory …