This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* A PHP appliction router for WordPress. Can be used with command line PHP to run WordPress: | |
* | |
* php -S localhost:8000 ./router.php | |
* | |
* This is a minimal version of the router from WP-CLI's "server" command. | |
*/ | |
define('ABSPATH', __DIR__ . '/'); | |
if (preg_match('/\.(?:png|jpg|jpeg|gif|css|js|webp|aiff)$/', parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH))) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A class for encoding and decoding information to and from BigInts | |
*/ | |
class CodedInt { | |
/** | |
* Construct a CodedInt | |
* | |
* @param {string|number|BigInt|Boolean} x | |
*/ | |
constructor(x) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Live.js - One script closer to Designing in the Browser | |
Written for Handcraft.com by Martin Kool (@mrtnkl). | |
Updated by Ross Wintle (https://rw.omg.lol) to: | |
- Use EventSource for server-sent events | |
- Use async/await | |
- Use fetch instead of XMLHttpRequest for requests | |
- Be a JS class | |
- Use a hash of the HTML to check for content changes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Live.js - One script closer to Designing in the Browser | |
Written for Handcraft.com by Martin Kool (@mrtnkl). | |
Updated by Ross Wintle (https://rw.omg.lol) to: | |
- Use async/await | |
- Use fetch instead of XMLHttpRequest | |
- Be a JS class | |
- Use a separate, project-global modified-time file to check for changes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## | |
## This script watches for changes in the specified directories and runs the build | |
## script when changes are detected. | |
## | |
## It writes a .modified_time file to the root of the project. This contains the | |
## timestamp of the last modification time. | |
## | |
## This is intended to be used with a front-end script that polls for changes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "your_organisation_or_name/your_project_name", | |
"repositories": [ | |
{ | |
"type": "composer", | |
"url": "https://wpackagist.org", | |
"only": [ | |
"wpackagist-plugin/*", | |
"wpackagist-theme/*" | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name WordPress Full Screen Editor killer | |
// @namespace http://rosswintle.uk/ | |
// @version 0.1 | |
// @description Auto-removes the full screen editor on WordPress sites | |
// @author Ross Wintle | |
// @match https://*/* | |
// @match http://*/* | |
// @grant none | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Feedbin: Keep selected centered | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Keeps the selected item vertically centered in Feedbin | |
// @author Ross Wintle | |
// @match https://feedbin.com/ | |
// @icon https://www.google.com/s2/favicons?domain=feedbin.com | |
// @grant none | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @returns {string} | |
*/ | |
function getApiKey() { | |
return '<YOUR_API_KEY>'; | |
} | |
/** | |
* @returns {Promise} | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Add a generic post meta filter that allows you to create filters like | |
* get_post_metadata_{$key} | |
*/ | |
add_filter('get_post_metadata', 'generic _meta_filter', 100, 5); | |
function generic_meta_filter($value, $object_id, $meta_key, $single, $meta_type) { | |
remove_filter('get_post_metadata' 'generic_meta_filter', 100, 5); |
NewerOlder