Skip to content

Instantly share code, notes, and snippets.

@Ereza
Ereza / submit_post.php
Last active June 15, 2024 05:23
Sample script to add a new post to a phpBB forum as a specific user
<?php
define('IN_PHPBB', true);
$phpbb_root_path = '../forum/';
$phpEx = substr(strrchr(__FILE__, '.') , 1);
include ($phpbb_root_path . 'common.' . $phpEx);
include ($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
$user_id = 755;
$forum_id = 32;
$subject = 'Missatge de prova';
@levlaz
levlaz / types_and_roles_demo.sql
Created March 28, 2016 19:11
Create Types and Roles If Not Exist in PostgreSQL
BEGIN;
DO $$
BEGIN
IF NOT EXISTS (SELECT 1 FROM pg_type WHERE typname = 'task_status') THEN
create type task_status AS ENUM ('todo', 'doing', 'blocked', 'done');
END IF;
END
$$;
CREATE TABLE IF NOT EXISTS