Skip to content

Instantly share code, notes, and snippets.

@zesda
zesda / cleanhtml.php
Created September 28, 2022 14:20 — forked from lyquix-owner/cleanhtml.php
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 = [
@zesda
zesda / flightplan.js
Created June 9, 2017 11:57 — forked from koenverburg/flightplan.js
deploy script for a laravel app
#!/usr/bin/env node
var plan = require('flightplan');
// configuration
plan.target('staging', [{
host: 'YOUR SERVER IP',
port: 22,
username: 'USER',
privateKey: '~/.ssh/id_rsa'
agent: process.env.SSH_AUTH_SOCK,