Skip to content

Instantly share code, notes, and snippets.

View tylershuster's full-sized avatar

Tyler Shuster tylershuster

View GitHub Profile
//
// @urbit/groups
//
// import Airlock, { Poke, Watch, scry } from '@urbit/airlock'
// declare types
//
interface Group {}
type Groups = Record<string, Group>;
export type GroupUpdate = GroupUpdateAddMembers | GroupUpdateRemoveMembers;
@lyquix-owner
lyquix-owner / cleanhtml.php
Last active August 14, 2023 12:30
PHP script to automatically clean dirty HTML. Removes unnecessary attributes (e.g. style, id, dir), replaces deprecated tags with valid ones (e.g. <b> to <strong>), and strips undesirable tags (e.g <font>). We have used this script to safely clean hundreds of blog posts that were littered with inline styling.
<?php
// List of tags to be replaced and their replacement
$replace_tags = [
'i' => 'em',
'b' => 'strong'
];
// List of tags to be stripped. Text and children tags will be preserved.
$remove_tags = [