Converts markdown documents to WordPress block markup offline, without the browser.
Usage:
npm install
bun md-to-blocks.ts document.md > output.html
// Run in a clone of isomorphic-git repo | |
import { GitPktLine } from './src/models/GitPktLine.js' | |
import { GitTree } from './src/models/GitTree.js' | |
import { GitAnnotatedTag } from './src/models/GitAnnotatedTag.js' | |
import { GitCommit } from './src/models/GitCommit.js' | |
import { GitPackIndex } from './src/models/GitPackIndex.js' | |
import { collect } from './src/internal-apis.js' | |
import { GitRemoteManager } from './src/managers/GitRemoteManager.js' | |
import { parseUploadPackResponse } from './src/wire/parseUploadPackResponse.js' |
async function fetchAudioBlob(textContent) { | |
const myHeaders = new Headers(); | |
myHeaders.append("Authorization", "Bearer TOKEN-HERE"); // Add your actual API key here | |
myHeaders.append("Content-Type", "application/json"); | |
const raw = JSON.stringify({ | |
"model": "tts-1", | |
"input": textContent, | |
"voice": "alloy" | |
}); |
Converts markdown documents to WordPress block markup offline, without the browser.
Usage:
npm install
bun md-to-blocks.ts document.md > output.html
<?php | |
/** | |
* Rewrites URLs in a WXR file while keeping track of the URLs found. | |
* | |
* This is a huge deal! It unlocks fast, streamed, resumable, fault-tolerant | |
* WordPress data migrations through WXR files AND directly between sites. | |
* | |
* In particular, this script: | |
* | |
* * Lists all the URLs found in the XML document |
<?php | |
/** | |
* Rewrites URLs in a WXR file while keeping track of the URLs found. | |
* | |
* This is a huge deal! It unlocks fast, streamed, resumable, fault-tolerant | |
* WordPress data migrations through WXR files AND directly between sites. | |
* | |
* In particular, this script: | |
* | |
* * Lists all the URLs found in the XML document |
<?php | |
/** | |
* A copy of the WP_Interactivity_API_Directives_Processor class | |
* from the Gutenberg plugin. | |
* | |
* @package WordPress | |
* @subpackage Interactivity API | |
* @since 6.5.0 | |
*/ |
{ | |
"landingPage": "/wp-admin/", | |
"steps": [ | |
{ | |
"step": "runPHP", | |
"code": "<?php require '/wordpress/wp-load.php'; $user_id = wp_create_user('myuser', 'mypass', 'myuser@localhost'); (new WP_User($user_id))->set_role('editor');" | |
}, | |
{ | |
"step": "login", | |
"username": "myuser", |
<?php | |
function download_url_stream_socket_client( $url ) { | |
$stream = stream_socket_client( | |
$url, | |
$errno, | |
$errstr, | |
30, | |
STREAM_CLIENT_CONNECT | STREAM_CLIENT_ASYNC_CONNECT | |
); |
/* | |
* This is a fun exploration I've done of porting the Tag Processor API over to C as a PHP extension. | |
* For now this is just a part of the parse_next_attribute() function. | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <stdbool.h> | |
#include <ctype.h> |
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="module"> | |
const TOKEN_KEY = 'githubToken'; | |
// OAUTH FLOW {{{ | |
// If there is a code in the URL, store it in localStorage | |
const urlParams = new URLSearchParams(window.location.search); | |
const code = urlParams.get('code'); |