Skip to content

Instantly share code, notes, and snippets.

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 / jetpack-set-opengraph-tags.php
Created November 22, 2022 18:14
Manually set opengraph tags in Jetpack
View jetpack-set-opengraph-tags.php
<?php
function wwu_twitter_filter_jetpack_open_graph_tags( $og_tags ) {
if ( is_page( 'twitter' ) ) {
$og_tags['og:image'] = 'https://secure.gravatar.com/blavatar/0d6c430459af115394a012d20b6711d6?s=240';
$og_tags['twitter:image'] = 'https://secure.gravatar.com/blavatar/0d6c430459af115394a012d20b6711d6?s=240';
}
return $og_tags;
}
@cagrimmett
cagrimmett / 5-1.txt
Last active September 24, 2022 17:26
WordPress Named Core Release Contributors, 5.0-6.0
View 5-1.txt
https://profiles.wordpress.org/0x6f0/
https://profiles.wordpress.org/1265578519-1/
https://profiles.wordpress.org/1naveengiri/
https://profiles.wordpress.org/aardrian/
https://profiles.wordpress.org/jorbin/
https://profiles.wordpress.org/abdullahramzan/
https://profiles.wordpress.org/abhayvishwakarma/
https://profiles.wordpress.org/abhijitrakas/
https://profiles.wordpress.org/ibachal/
https://profiles.wordpress.org/achbed/
View tzprofiles verification
I am attesting that this GitHub handle cagrimmett is linked to the Tezos account tz1Q2eekfg9ZAoxowc7YPeC14EfJLxbd1Sfw for tzprofiles
sig:edsigtsT3Zc1qYQW6sJJoavVWM1bEQn2utU6NG4795U1qMANDKwrFPNgb9ZhoDMwAN3p9dKDzgYacBynJgLpcw3QatL64GbatWn
@cagrimmett
cagrimmett / post-redirects.php
Last active November 26, 2019 23:55
redirect blog.crash.co posts to crash.co
View post-redirects.php
<?php
add_action( 'template_redirect', function() {
global $post;
if ( current_user_can('administrator') ) { return; }
if (is_single()){
$cat = get_the_category();
wp_redirect( 'https://crash.co/content/' . $cat[0]->slug . '/' . $post->post_name );
die;
} else {
wp_redirect( 'https://crash.co/content/all' );