Skip to content

Instantly share code, notes, and snippets.

View smileBeda's full-sized avatar
💭
I may be slow to respond.

Beda Schmid smileBeda

💭
I may be slow to respond.
View GitHub Profile
@smileBeda
smileBeda / synaptics-config.txt
Last active December 8, 2023 08:21
Synaptics Config
##
# Part of a full "MacOS on Gnome X experience setting"
# Here we control general clickpad behaviour. Also requires Daemon to run, see general readme.
# Requires Fusuma https://github.com/iberianpig/fusuma, xdotool
# Other settings and controls done with:
# libinput-three-finger-gestures https://github.com/marsqing/libinput-three-finger-drag
# syngestures https://github.com/mqudsi/syngesture/issues (only if you truly need two-finger history navigation)
# synaptics https://wiki.archlinux.org/title/Touchpad_Synaptics
# Kinto https://github.com/rbreaves/kinto
# Xorg
##
# Part of a full "MacOS on Gnome X experience setting"
# Here we control 4 and 3 finger gestures (pinch) and 4 finger gestures (swipe)
# Requires Fusuma https://github.com/iberianpig/fusuma, xdotool
# Other settings and controls done with:
# libinput-three-finger-gestures https://github.com/marsqing/libinput-three-finger-drag
# syngestures https://github.com/mqudsi/syngesture/ (only if you truly need two-finger history navigation)
# synaptics https://wiki.archlinux.org/title/Touchpad_Synaptics
# Kinto https://github.com/rbreaves/kinto
# Xorg
@smileBeda
smileBeda / gist:49d78c6779179c4f8fc69fe5ca6d2f48
Created July 27, 2023 03:42
JS to fix the WP Delete User reassign dropdown
jQuery(document).ready(function($) {
// Hide the existing dropdown
$('select[name="reassign_user"]').hide();
// Create a new dropdown
var $dropdown = $('<select id="your-admin-select2-users"></select>');
$('select[name="reassign_user"]').after($dropdown);
// Initialize Select2 and AJAX
$dropdown.select2({
@smileBeda
smileBeda / gist:e439854fba76302c72b11318dc60b591
Created July 27, 2023 03:40
Fix the WordPress Delete Users functionality
/**
* User AJAX Search
*
* Used for the Select2 in the User Delete admin area
*
* @since Added 2023-07-26 11:49
* @author Beda Schmid <beda@tukutoi.com>
* @return void
*/
public function ajax_get_users() {

Using Git to Manage a Live Web Site

Overview

As a freelancer, I build a lot of web sites. That's a lot of code changes to track. Thankfully, a Git-enabled workflow with proper branching makes short work of project tracking. I can easily see development features in branches as well as a snapshot of the sites' production code. A nice addition to that workflow is that ability to use Git to push updates to any of the various sites I work on while committing changes.

Contents

/**
* html2pdf.js v0.9.2
*
* Copyright (c) 2020 Erik Koopmans https://github.com/eKoopmans/html2pdf.js
*
* Released under the MIT License.
*
*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.html2pdf=e()}(this,function(){"use strict";function t(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function e(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function A(t,e){return e={exports:{}},t(e,e.exports),e.exports}var r="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=A(function(e,A){e.exports=function(){function n(t){var e=0;if(71!==t[e++]||73!==t[e++]||70!==t[e++]||56!==t[e++]||56!=(t[e++]+1&253)||97!==t[e++])throw"Invalid GIF 87a/89a header.";var A=t[e++]|t[e++]<<8,r=t[e++]|t[e++]<<8,n=t[e++],o=n>>7,a=1<<1+(7&n);t[e++],t[e++];var s=null;o&&(s=e,e+=3*a);var c=!0,l=[],u=0,h=nul
/**
* html2pdf.js v0.9.1
* Copyright (c) 2018 Erik Koopmans
* Released under the MIT License.
*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.html2pdf=e()}(this,function(){"use strict";function t(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function e(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function A(t,e){return e={exports:{}},t(e,e.exports),e.exports}var r="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(A(function(e,A){e.exports=function(){function e(t){return"function"==typeof t}function A(){var t=setTimeout;return function(){return t(n,1)}}function n(){for(var t=0;t<y;t+=2){var e=H[t],A=H[t+1];e(A),H[t]=void 0,H[t+1]=void 0}y=0}function i(t,e){var A=this,r=new this.constructor(a);void 0===r[S]&&B(r);var n=A._state;if(n){var i=arguments[n-1];C(function(){return g
(function( $ ) {
'use strict';
jQuery(document).ready(function($) {
var myarea = document.getElementById('content');
wp.CodeMirror.defineMode("tkt_shortcodes", function(config, parserConfig) {
var indentUnit = config.indentUnit;
var Kludges = {
add_action('init','safe_remove_backend_admin_access_for_role');
function safe_remove_backend_admin_access_for_role(){
if( current_user_can('editor') || current_user_can('administrator') )//Your roles
return;
if( is_admin() && !defined('DOING_AJAX') ){//IMPORTANT! Front end AJAX events are excluded...
if(isset( $_GET[ 'action'] ) && 'trash' == $_GET[ 'action'])//Perhaps you have a call to some WP Admin Operation that needs whitelisting...
return;
wp_redirect( home_url() );
exit;
add_action('init', 'make_registered_flat_taxonomies_hierarchical');
function make_registered_flat_taxonomies_hierarchical() {
// Maintain the built-in rewrite functionality of WordPress tags
global $wp_rewrite;
$rewrite = array(
'hierarchical' => false, // Maintains tag permalink structure