Skip to content

Instantly share code, notes, and snippets.

FROM debian:buster
RUN apt-get update && \
apt-get -y install curl unzip vim tmux php-mbstring php-xml php
RUN mkdir /sandbox
WORKDIR /sandbox
RUN curl -sSL https://getcomposer.org/installer | php
RUN php composer.phar create-project picocms/pico-composer pico
@dimonf
dimonf / dokuwiki_date_from_filename.py
Last active July 23, 2020 15:30
replace "created" date in dokuwiki meta files with the date, derived from the file (page) name
#!/usr/bin/python3
'''In dokuwiki metadata is stored in separate files, such as data/meta[/namespace]/[...]/page_name.meta
It is critical for blog plugin to have correct "created" timestamp for individual entries (files)
as this determines the order the entries appear on summary page. This scirpt helps to 'restore' the
"created" timestamp in metafiles in case a metafile created anew by dokuwiki. This migh happen if
for some reason meta file were lost or didn't exist at all (e.g. the blog files were imported from
other app, such as vimwiki)."created" - is a tagname in dokuwiki meta files.
The script searches through meta files in dokuwiki data folder and replaces timestamp with
new one, generated from the date of the file, which is encoded in file name prefix of YYYY-DD-MM format.