Skip to content

Instantly share code, notes, and snippets.

View jshwlkr's full-sized avatar
🙈

Joshua Walker jshwlkr

🙈
View GitHub Profile
@jshwlkr
jshwlkr / user.js
Last active August 8, 2025 22:28
Firefox user profile
//
/* You may copy+paste this file and use it as it is.
*
* If you make changes to your about:config while the program is running, the
* changes will be overwritten by the user.js when the application restarts.
*
* To make lasting changes to preferences, you will have to edit the user.js.
*/
/****************************************************************************
@jshwlkr
jshwlkr / functions.php
Created July 24, 2025 17:57
Disable XMLRPC endpoint
public function disable_xmlrpc() {
add_filter( 'xmlrpc_enabled', '__return_false' );
add_action(
'xmlrpc_call',
function () {
wp_die( 'XML-RPC services are disabled on this site.', 'XML-RPC Disabled', array( 'response' => 403 ) );
}
);
}
@jshwlkr
jshwlkr / functions.php
Created July 24, 2025 17:55
Prevent user enumeration in WordPress for unathenticated users
public function disable_user_endpoint() {
add_filter(
'rest_authentication_errors',
function ( $access ) {
if ( ! isset( $_SERVER['REQUEST_URI'] ) ) {
return $access;
}
if ( ! is_user_logged_in() || ! current_user_can( 'list_users' ) ) {
“what|why|how|when|where|who|^is|^are|vs”
@jshwlkr
jshwlkr / post.code-snippets
Created February 5, 2025 04:38
11ty frontmatter snippet for vscode
{
"post frontmatter": {
"prefix": "fm",
"body": [
"---",
"title: $1",
"date: $CURRENT_YEAR-$CURRENT_MONTH-${CURRENT_DATE}T$CURRENT_HOUR:$CURRENT_MINUTE:$CURRENT_SECOND$CURRENT_TIMEZONE_OFFSET",
"id: $UUID",
"tags:",
" - $2",
local wezterm = require 'wezterm'
local module = {}
function module.apply_to_config(config)
config.inactive_pane_hsb = {
saturation = 0.8,
brightness = 0.7
}
"$schema" = 'https://starship.rs/config-schema.json'
format = """
[\uE0B6](fg:blue)[$directory](bg:blue)\
[\uE0B0](fg:blue bg:red)$git_branch\
[\uE0B0](fg:red bg:green)$git_status\
[\uE0B0](fg:green bg:none) $all $character\
"""
palette = 'catppuccin_frappe'
@jshwlkr
jshwlkr / bookmarklet.js
Created July 17, 2024 02:53
Searches for previous incarnations of the current page on the Wayback Machine. Source: https://lmnt.me/blog/two-bookmarklets.html
javascript:(function()%7Bvar%20url%20%3D%20document.URL%3B%0Avar%20newURL%20%3D%20%60https%3A%2F%2Fweb.archive.org%2Fweb%2F%24%7Burl%7D%60%3B%0A%0Awindow.location.href%20%3D%20newURL%3B%7D)()%3B
@jshwlkr
jshwlkr / bookmarklet.js
Created July 17, 2024 02:51
This opens a new tab and searches the English Wikipedia for the selected text on the current page. If you’ve selected no text, it goes to the Wikipedia home page. Source: https://lmnt.me/blog/two-bookmarklets.html
javascript:(function(){var selectedText=window.getSelection().toString().trim();var searchUrl=selectedText?'https://en.wikipedia.org/wiki/Special:Search?search='+encodeURIComponent(selectedText):'https://en.wikipedia.org/wiki/Main_Page';window.open(searchUrl,'_blank');})();
@jshwlkr
jshwlkr / functions.php
Created August 30, 2022 02:45
add customizer link back to admin
add_action( 'customize_register', function ( $manager ) { }, 10, 1 );