Skip to content

Instantly share code, notes, and snippets.

View dominickj-tdi's full-sized avatar

dominickj-tdi

View GitHub Profile
@dominickj-tdi
dominickj-tdi / structured_form.py
Created January 31, 2020 17:29
Structured JSON-style python form converter
"""
The goal of this code is to allow submitting data using the
naming convention specified in the un-implemented WC3 JSON
form proposal.
https://www.w3.org/TR/html-json-forms/
This would allow forms to better submit more structured data.
This will differ from the W3C proposal in a few important ways:
@dominickj-tdi
dominickj-tdi / demonstration.php
Created November 2, 2020 15:59
Demonstrate possible bug with PDO. The following does not work, but does if you replace `$database->query` with prepared statements.
<?php
/**
* Perform a cleanup that spans multiple tables and columns
*
* @param string $dir The directory to search. This should be
* a relative directory starting with "upload/", e.g.
* "upload/galleries/". The trailing slash is required.
* @param PDO $database The database object to use
* @param string[][] $searchArray An array of arrays of exactly