Skip to content

Instantly share code, notes, and snippets.

View savolai's full-sized avatar

Olli Savolainen savolai

View GitHub Profile
@savolai
savolai / gist:eaf4372541ca16a675db32946da53ed3
Last active April 28, 2025 18:25
SQL for exporting Things 3 for Mac projects - with given keyword in the project name database - into HTML that can be imported in Notion.
Export Things 3 Tasks and Subtasks to HTML
This SQL script extracts tasks and subtasks (checklist items) from a Things 3 SQLite database.
Features:
• Projects grouped with their description
• Tasks listed under each project
• Completed tasks and subtasks are prepended with X
• Creation, due, deadline, and completion dates included in semantic <time> tags
• Task notes shown under tasks
@savolai
savolai / renderer.php
Last active June 14, 2019 11:59
simple_nav renderer.php
<?php
/**
* Used to render the navigation items in the simple_nav block
*
*/
class block_simple_nav_renderer extends plugin_renderer_base {
public function simple_nav_tree($items) {
$depth = 0;
$type = 0;
/**
* @brief executeQueriesFromFile Read each line from a .sql QFile
* (assumed to not have been opened before this function), and when ; is reached, execute
* the SQL gathered until then on the query object. Then do this until a COMMIT SQL
* statement is found. In other words, this function assumes each file is a single
* SQL transaction, ending with a COMMIT line.
*/
void executeQueriesFromFile(QFile *file, QSqlQuery *query)
{