Skip to content

Instantly share code, notes, and snippets.

View nylen's full-sized avatar
🏗️
Constructing

James Nylen nylen

🏗️
Constructing
View GitHub Profile
// ==UserScript==
// @name GitHub character counter
// @namespace https://nylen.io/
// @version 0.1
// @description Show a character count of the commit message summary when merging PRs on GitHub
// @author James Nylen
// @match https://github.com/*/pull/*
// @grant none
// ==/UserScript==
@nylen
nylen / README.md
Last active December 20, 2021 09:05
Fix MySQL errors with WordPress + DigitalOcean managed MySQL

When running WordPress or ClassicPress using a DigitalOcean managed MySQL database you may experience errors like the following:

Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'dbname.wp_posts.post_date' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by for query SELECT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM wp_posts WHERE post_type = 'post' AND post_status = 'publish' GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC made by require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/themename/404.php'), the_widget, WP_Widget_Archives->widget, wp_get_archives

>Expression #1 of ORDER BY clause is not in SELECT list, references column 'dbname.wp_posts.post_date' which is not in SELECT list; this is incompatible with DISTINCT fo

@nylen
nylen / hide-wp5-updates.php
Last active July 6, 2019 06:14
Keep a WordPress site on 4.9.x with security updates
<?php
/**
* Plugin Name: Ignore WP5 Updates
* Plugin URI: https://gist.github.com/nylen/44adecb537d65bd4c64be8007cd1523b
* Description: Keep a site on WP 4.9.x with security updates
* Version: 1.1.0
* Author: James Nylen
* License: GPLv2 - https://www.gnu.org/licenses/gpl-2.0.html
*/
// ==UserScript==
// @name Fider (ClassicPress petitions) improvements
// @version 2
// @grant none
// @match *://petitions.classicpress.net/notifications
// ==/UserScript==
function go() {
const css = document.createElement('style');
css.textContent = `
<?php
require_once __DIR__ . '/src/wp-load.php';
echo "Type | Generator\n";
echo "|--|--|\n";
foreach ( array ( 'html', 'xhtml', 'atom', 'rss2', 'rdf', 'comment', 'export' ) as $type ) {
echo "$type | `" . get_the_generator( $type ) . "`\n";
}
$ ack -i '(#(5b9d99|00b9eb|0073aa|00a0d2)\b)|\b30,\s*140,\s*190'
src/wp-includes/functions.php:2821: color: #0073aa;
src/wp-includes/functions.php:2825: color: #00a0d2;
src/wp-includes/functions.php:2831: 0 0 2px 1px rgba(30, 140, 190, .8);
src/wp-includes/functions.php:2834: 0 0 2px 1px rgba(30, 140, 190, .8);
src/wp-includes/js/mediaelement/wp-mediaelement.css:32: background: #0073aa;
src/wp-includes/js/thickbox/thickbox.css:146: color: #00a0d2;
src/wp-includes/js/thickbox/thickbox.css:152: 0 0 2px 1px rgba(30, 140, 190, .8);
src/wp-includes/js/thickbox/thickbox.css:155: 0 0 2px 1px rgba(30, 140, 190, .8);
src/wp-includes/css/wp-pointer.css:19: background: #00a0d2;
This file has been truncated, but you can view the full file.
diff -ur build-unminified/wp-admin/js/accordion.min.js build-branch-unminified/wp-admin/js/accordion.min.js
--- build-unminified/wp-admin/js/accordion.min.js 2018-10-09 02:03:31.724590794 -0500
+++ build-branch-unminified/wp-admin/js/accordion.min.js 2018-10-09 02:01:15.815639990 -0500
@@ -1,18 +1,19 @@
-! function(a) {
- function b(a) {
- var b = a.closest(".accordion-section"),
- c = b.find("[aria-expanded]").first(),
- d = b.closest(".accordion-container"),
This file has been truncated, but you can view the full file.
diff -ur build-unminified/wp-admin/js/accordion.min.js build-branch-unminified/wp-admin/js/accordion.min.js
--- build-unminified/wp-admin/js/accordion.min.js 2018-10-08 22:57:58.537502636 -0500
+++ build-branch-unminified/wp-admin/js/accordion.min.js 2018-10-08 22:55:09.208159868 -0500
@@ -1,18 +1,19 @@
-! function(a) {
- function b(a) {
- var b = a.closest(".accordion-section"),
- c = b.find("[aria-expanded]").first(),
- d = b.closest(".accordion-container"),
diff -ur build-unminified/wp-admin/css/about.min.css build-branch-unminified/wp-admin/css/about.min.css
--- build-unminified/wp-admin/css/about.min.css 2018-10-06 22:35:47.793250908 -0500
+++ build-branch-unminified/wp-admin/css/about.min.css 2018-10-06 22:33:12.760091326 -0500
@@ -39,7 +39,8 @@
}
.wp-badge {
- background: url(../images/w-logo-white.png?ver=20160308) center 25px no-repeat #0073aa;
+ background: #0073aa url(../images/w-logo-white.png?ver=20160308) no-repeat;
+ background-position: center 25px;
This file has been truncated, but you can view the full file.
diff -ur build-unminified/wp-admin/js/code-editor.min.js build-branch-unminified/wp-admin/js/code-editor.min.js
--- build-unminified/wp-admin/js/code-editor.min.js 2018-10-06 21:45:40.354682051 -0500
+++ build-branch-unminified/wp-admin/js/code-editor.min.js 2018-10-06 21:42:42.693357446 -0500
@@ -26,10 +26,9 @@
}), b.on("blur", d), b.on("startCompletion", function() {
b.off("blur", d)
}), b.on("endCompletion", function() {
- var a = 500;
b.on("blur", d), _.delay(function() {