Skip to content

Instantly share code, notes, and snippets.

View fascinated's full-sized avatar

Anthony V fascinated

View GitHub Profile
@fascinated
fascinated / fix_newlines.php
Last active December 30, 2021 17:03
This script fixes missing newlines in a Movable Type export file
<?php
// -----------------------------
// When Movable Type (for example, version 4.32) exports posts, the files
// have \n instead of <br> in the HTML bodies of posts and comments to
// represent newlines. This confuses WordPress and corrupts the import process.
//
// This script replaces the double-newlines in post/comment bodies with <br><br>
// so that a WordPress import can proceed correctly
//
/*
Uses https://github.com/noble/noble / https://github.com/abandonware/noble to read temperature and humidity from the iBeacon advertising packets from the Moat Technolgies sensor (likely a branded version of OEM iB004N by AnkhMaway / Jaalee)
Before using, you need to get the Mac address of your beacon, and the beacon itself has to be configured to provide temp/humidity in the advertising packets (the Moat version is pre-configured this way, but the OEM may not be).
npm install @abandonware/noble
node read-th.js
*/