Skip to content

Instantly share code, notes, and snippets.

View RNCTX's full-sized avatar

Robert Clayton RNCTX

View GitHub Profile
@RNCTX
RNCTX / alpine_htmx.md
Last active October 30, 2025 01:58
Alpine.js + HTMX + Django server-side interactivity starter pack

Alpine.js + HTMX + Django server-side interactivity starter pack

Reasoning for this

There are lots of guides and courses out there on HTMX and Alpine.js separately, but I didn't find many with the particulars of using them together for persistence of instant client-side interactions, so this is an example of such a thing. I've taken a bootstrap 5 theme from one of the marketplace sites, and made one thing in it data driven and supportive of instant user gratification, persisted to the database as user preferences in Django.

Consider the following:

A static_menu.html

@RNCTX
RNCTX / ssl_renew
Created September 28, 2019 20:49
DD-WRT letsencrypt renewal script.
#!/bin/sh
export PATH=/opt/bin:/opt/sbin:$PATH
mount -o remount,rw /opt
rm -f /tmp/root/acme.log
/opt/etc/init.d/S80nginx stop
acme.sh --renew --ca-path /opt/etc/ssl/certs --cert-home /opt/etc/ssl --home /opt/root/.acme --log /tmp/root/acme.log -d '*.DOMAIN.NET' --dns dns_aws --ecc
acme.sh --install-cert --ca-path /opt/etc/ssl/certs --cert-home /opt/etc/ssl --home /opt/root/.acme --log /tmp/root/acme.log -d '*.DOMAIN.NET' --ecc \
--cert-file '/opt/etc/ssl/pem/*.DOMAIN.NET/cert.pem' \
--key-file '/opt/etc/ssl/pem/*.DOMAIN.NET/key.pem' \
--fullchain-file '/opt/etc/ssl/pem/*.DOMAIN.NET/fullchain.pem'
@RNCTX
RNCTX / jekyll_s3_dropbox.sh
Last active July 28, 2017 17:24
Jekyll/Amazon S3/Dropbox cron script
#!/bin/bash
export PATH="$PATH"
############ CHANGE VARS BELOW ##############
BASH_ENV="/home/ubuntu/.bashrc"
sourcedir="/home/ubuntu/Dropbox"
destdir="/home/ubuntu/_site"
log="/home/ubuntu/jekyll_build.log"
s3_website_confdir="/home/ubuntu"
dropbox="/opt/dropbox/dropbox.py"
jekyll="/home/ubuntu/.rvm/gems/ruby-2.3.0/wrappers/jekyll"