Skip to content

Instantly share code, notes, and snippets.

View pb.json
{
"title": "People and Blogs",
"script": "console.log ('Hi, fellow blogger!');",
"tabs": {
"interviews": {
"name": "P&B Interviews",
"description": "Feed of the latest P&B interviews",
"screenname": "pbnewsproduct",
"catname": "pbseries"
},
View wpdevnews.json
{
"title": "WP Dev News",
"description": "All the news that's fit to error_log()",
"image": "https://make.wordpress.org/design/files/2016/09/WordPress-logotype-wmark.png",
"script": "console.log ('Hello, WP dev!')",
"style": [
".divProductLogo {width: 125px;}",
".divProductTagline {color: blue}"
],
"tabs": {
View nptest.json
{
"title": "news.scripting.com",
"description": "It's even worse than it appears.",
"image": "https://imgs.scripting.com/2023/12/24/slugger.png",
"script": "console.log ('Hello World')",
"style": [
".divProductTagline {font-style: italic}",
".divProductTagline {color: blue}"
],
"tabs": {
View filter.js
var urlTemplate = "https://drummer.land/chuck@grimmett.co/MakeWordPress.opml";
const request = require ("request");
function httpRespond (code, type, val, headers) {
if (headers === undefined) {
headers = new Object ();
}
if (type === undefined) { //7/20/18 by DW
type = "text/plain";
}
View csv-to-opml.php
<?php
if ($argc !== 2) {
echo "Usage: php csv-to-opml.php <csvFilePath>\n";
exit(1);
}
$csvFilePath = $argv[1];
// Define the output OPML file path
$opmlFilePath = 'output.opml'; // You can customize the output file name here
@cagrimmett
cagrimmett / yotpo-disable-updates.php
Created September 6, 2023 14:04
Disable updates for Yotpo
View yotpo-disable-updates.php
<?php
/*
Plugin Name: Disable Auto-update for Yotpo Social Reviews for WooCommerce
Description: This plugin disables auto-updates for the Yotpo Social Reviews for WooCommerce plugin.
*/
function disable_autoupdate_specific_plugins($update, $item) {
// Array of plugin slugs to never auto-update
$plugins = array(
'yotpo-social-reviews-for-woocommerce',
@cagrimmett
cagrimmett / wayback-checker.php
Last active August 24, 2023 20:05
Script to check if broken links exist on the Wayback machine
View wayback-checker.php
<?php
// Function to check if a URL exists in Wayback Machine
function checkWayback( $url ) {
$apiUrl = 'https://archive.org/wayback/available?url=' . urlencode( $url );
$response = file_get_contents( $apiUrl );
$json = json_decode( $response, true );
if ( isset( $json['archived_snapshots']['closest']['url'] ) ) {
return $json['archived_snapshots']['closest']['url'];
}
@cagrimmett
cagrimmett / socialshareurls.txt
Created August 24, 2023 18:01
Social share links
View socialshareurls.txt
blogger.com/blog-this
buffer.com/add
digg.com/submit
facebook.com/sharer
flipboard.com/redirect
getpocket.com/edit
getpocket.com/save
instapaper.com/hello2
line.me/R/msg
linkedin.com/cws/share
@cagrimmett
cagrimmett / well-known-feeds.php
Created August 24, 2023 15:29
mu-plugin for /.well-known/feeds
View well-known-feeds.php
<?php
/*
Plugin Name: Custom OPML Feed
Description: Implements a custom OPML feed at /.well-known/feeds/
Author: cagrimmett
*/
// Add custom rewrite rule
function custom_opml_rewrite_rule() {
add_rewrite_rule( '^\.well-known/feeds/?$', 'index.php?custom_opml_feed=1', 'top' );
@cagrimmett
cagrimmett / .block
Last active July 31, 2023 18:45
Let's Make a Grid with D3.js
View .block
license: gpl-3.0
height: 510