Skip to content

Instantly share code, notes, and snippets.

@apowell656
apowell656 / pelican2hugo.py
Created May 16, 2025 15:02 — forked from andreagrandi/pelican2hugo.py
Python script to migrate posts from Pelican to Hugo
# Migration script from Pelican to Hugo
import os, re, shutil
from pathlib import Path
INPUT_FOLDER = "content"
OUTPUT_FOLDER = "content-hugo"
# Custom sort key function
def sort_key(path):
# Extract the base filename without the extension
@apowell656
apowell656 / .gitmessage
Created April 22, 2025 21:11 — forked from median-man/.gitmessage
This commit message template helps you write **useful** commit messages.
# <type>: <subject> (Max 50 char, Why is this change necessary?)
# |<---- Using a Maximum Of 50 Characters ---->|
# |<---- Try To Limit Each Line to a Maximum Of 72 Characters ---->|
# Explain how the commit addresses the issue
# IMPORTANT!! Describe any side effects of the change.
# Provide links or keys to any relevant tickets, articles or other resources
# Examples: "Jira issue [ABC-123]" or "Closes Github issue #123"
@apowell656
apowell656 / ubuntu-server-multicast-dns.md
Created November 1, 2024 12:37
Enable multicast DNS on Ubuntu Server

Enabling multicast DNS (mDNS) on a server allows other hosts on the local network to address the server as <hostname>.local.

mDNS is disabled by default in Ubuntu Server:

$ resolvectl mdns
Global: no
Link 2 (eno1): no
@apowell656
apowell656 / 1 - Adding Custom HTML Tags in the Publii Toolbar.md
Created September 9, 2024 15:11 — forked from candidexmedia/1 - Adding Custom HTML Tags in the Publii Toolbar.md
Experiments in Publii TinyMCE WYSIWYG Editor Extensions (customElementsMode, Formats, Blocks, Templates)

Custom HTML Elements (via customElementsMode)

Custom Elements allow you to wrap selected text in the editor with the HTML tag and CSS class (optionally) of your choice <element>like this</element>. These wrappers can be given custom names and grouped in subfolders.

demo

A huge thanks to @b0fh for guidance on this in the forum and GH discussion.

Instructions

@apowell656
apowell656 / models.py
Created August 5, 2023 17:08 — forked from Vibhu-Agarwal/models.py
Example Describing How to Serialize Multiple Models through One Serializer (Case of Foreign Keys) | Django Rest Framework
from django.db import models
class ModelA(models.Model):
fieldA1 = models.CharField(max_length=100, unique=True)
fieldA2 = models.TextField(validators=[URLValidator()], blank=True, null=True)
fieldA3 = models.CharField(max_length=100, unique=True, null=True, blank=True)
field4 = models.BooleanField(default=True)
@apowell656
apowell656 / git-deployment.md
Created July 31, 2023 11:39 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@apowell656
apowell656 / make-vcard.py
Created January 21, 2023 21:32 — forked from gerwin3/make-vcard.py
Generate vCard using Python
"""
This little script can generate a valid .vcf (vCard). It will ask you to fill
in some details and write the vcf-file.
"""
def main():
print('Please enter contact details:')
first_name = input(' - First name : ')
last_name = input(' - Last name : ')
email = input(' - E-mail address : ')
@apowell656
apowell656 / wp-bootstrap5.0-pagination.php
Created June 25, 2021 17:13 — forked from mtx-z/wp-bootstrap5.0-pagination.php
Wordpress 5.7 Bootstrap 5.0 pagination (with custom WP_Query() and global $wp_query support)
<?php
/**
* @param WP_Query|null $wp_query
* @param bool $echo
* @param array $params
*
* @return string|null
*
* Using Bootstrap 4? see https://gist.github.com/mtx-z/f95af6cc6fb562eb1a1540ca715ed928
*
@apowell656
apowell656 / _readme.md
Created May 18, 2020 15:46 — forked from gka/_readme.md
PHP Endpoint for Github Webhook URLs

PHP Endpoint for Github Webhook URLs

If you love deploying websites using Github, but for some reason want to use your own server, this script might be exactly what you need.

  1. Put github.php somewhere on your PHP-enabled web server, and make it accessible for the outside world. Let's say for now the script lives on http://example.com/github.php
@apowell656
apowell656 / .git-commit-template
Created November 29, 2019 16:54 — forked from zakkak/.git-commit-template
This commit message template that helps you write great commit messages and enforce it across your team.
# [<tag>] (If applied, this commit will...) <subject> (Max 72 char)
# |<---- Preferably using up to 50 chars --->|<------------------->|
# Example:
# [feat] Implement automated commit messages
# (Optional) Explain why this change is being made
# |<---- Try To Limit Each Line to a Maximum Of 72 Characters ---->|
# (Optional) Provide links or keys to any relevant tickets, articles or other resources
# Example: Github issue #23