Skip to content

Instantly share code, notes, and snippets.

View millipedia's full-sized avatar

millipedia millipedia

View GitHub Profile
@millipedia
millipedia / calculate_reading_time.php
Last active December 20, 2021 12:23
Processwire hook to calculate article reading time
<?php
/**
*
* Calculate reading time on page save.
* Add this to your ready.php file.
* Uses a field called 'article_read_time' to store the value
* and the field 'page_content' as the readable content.
* You'll need to update those field names if yours are different.
*
@millipedia
millipedia / import_example.php
Created September 10, 2021 11:47
Processwire example import scrip
<?php namespace ProcessWire;
/**
*
* Import images from a CSV from WP (or wherever).
* In this case CSV has image path and page alias.
*
*/
include("index.php");
@millipedia
millipedia / pw_ploi_nginx
Last active November 25, 2025 14:47
nginx conf tweaks for PW on Ploi
########## begin custom config
# mostly from jacmaes setup in the PW forum.
location ~* ^.+\.(css|js|jpg|jpeg|gif|png|ico|gz|svg|svgz|ttf|otf|woff|woff2|eot|mp4|ogg|ogv|webm|webp|zip|swf|map)$ {
add_header Access-Control-Allow-Origin "*";
expires 48h;
access_log off;
try_files $uri $uri/ /index.php?it=$uri&$args;
}