Skip to content

Instantly share code, notes, and snippets.

View dhaupin's full-sized avatar

dhaupin dhaupin

View GitHub Profile
Error with Permissions-Policy header: Unrecognized feature: 'interest-cohort'.
auth:1 Loading the script 'https://static.cloudflareinsights.com/beacon.min.js/v8c78df7c7c0f484497ecbca7046644da1771523124516' violates the following Content Security Policy directive: "script-src 'self' 'unsafe-inline' 'unsafe-eval' https://fonts.googleapis.com https://*.cloudflare.com https://*.google.com". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback. The action has been blocked.
index-CjbIPpT4.js:361 [OK] Registered plugin: resend (scope: plugin)
index-CjbIPpT4.js:361 [SYS] Created registry for scope: plugin
index-CjbIPpT4.js:361 [OK] Registered plugin: resend (scope: plugin)
index-CjbIPpT4.js:361 [SYS] Plugin system initialized
index-CjbIPpT4.js:413 [Turnstile] Hook init, enabled: true siteKey: 0x4AAAAAAC shouldSkip: false
index-CjbIPpT4.js:413 [Turnstile] Hook init, enabled: true siteKey: 0x4AAAAAAC shouldSkip: false
2index-CjbIPpT4.js:413 [Turnstile] Hook init, enabled: true siteK
@dhaupin
dhaupin / gist:28328adbb95d09ce6f05bedb70b7f925
Created April 7, 2026 23:12
Moto Android 15 Touch Sensitivity Settings
Android settings and ADB commands that may or may not increase touch sensitivity on moto devices.
------------------------------------------------
settings put system touch_sensitivity_mode 1
settings put secure screen_protector_mode 1
------------------------------------------------
settings put system glove_use 1
@dhaupin
dhaupin / dev_wp_shortcode_woo_login_register.php
Last active November 15, 2020 06:16
Wordpress shortcode to display WP or Woocommerce login forms
<?php
/**
* Shortcode - Render Wordpress login form
**/
add_shortcode('wp_login_form', function() {
if (is_user_logged_in()) {
} else {
ob_start();
@dhaupin
dhaupin / dev_script_ckeditor_plugin_wrapper.js
Last active June 28, 2017 18:51
CKEditor - Example Plugin Wrapper/Init for Config.js - Extending Autosave
// Make sure you include the plugin_wrapper as last item in config.extraPluins
CKEDITOR.editorConfig = function(config) {
config.extraPlugins = 'autosave,plugin_wrapper';
// Define empty autosave object
config.autosave = {};
}
// Extend instance plugins
CKEDITOR.plugins.add('plugin_wrapper', {
@dhaupin
dhaupin / dev_script_get_date_offset.php
Last active June 7, 2017 17:44
Function: Get date offset accounting for weekends and holidays
<?php
// Requires PHP 5.4+
function getWorkingDaysFrom($start, $amtOfDays) {
$globalDays = 0; // a global addition to $amtOfDays (such as a minimum shipping time of 3 days across all objects)
$amtOfDays = $amtOfDays + $globalDays; // set base amount of days for initial range before calculations applied
$ignore = array('6', '7'); // days of the week to ignore (weekends are 6 & 7) in ISO-8061
$holidays = array(
(new DateTime('first monday of january +1 year'))->format('*-m-d'), // new years day (celebrated)
@dhaupin
dhaupin / dev_opencart_img_check.php
Last active October 3, 2018 04:47
Opencart - Crawls over database looking for images/pdfs used and outputs them as a simple text list. CP/Rclone/PHP can use this list to truncate out unused files.
<?php
# Idea from: https://github.com/zenseo/opencart-needless-image
# PHP is not good enough to run this through a large store with many images
# Bash cp cant hold enough arguments from file output unless its batched
# Rclone is the best bet:
# rsync -asv --dry-run --recursive --remove-source-files --checksum --files-from=some-file.txt . destination/
function findImages() {
$tables_to_check = array(
@dhaupin
dhaupin / dev_script_colorbox_init.js
Created May 18, 2017 15:04
Script - Colorbox initialization with back button support
<script type="text/javascript">
$(document).ready(function() {
$('.colorbox').colorbox({
onLoad: function() {
history.pushState(null, document.title + ' [colorbox-active]', window.location.pathname + window.location.search + '#colorbox-active');
window.onpopstate = function(event) {
$.colorbox.close();
};
},
onClosed: function() {
@dhaupin
dhaupin / etc_bash.bashrc.sh-whm
Last active May 24, 2017 15:51
Bash functions to Increase/decrease WHM backend PHP limits
cyan=$(tput setaf 6)
bold=$(tput bold)
reset=$(tput sgr0)
whm-max() {
# Boosts WHM power for exports/imports
if [ -z "$1" ]; then
vars="3000"
else
vars=$1
@dhaupin
dhaupin / dev_smarty_cheatsheat.txt
Last active November 8, 2024 19:11
Smarty - Handy Snippets
## Grabbing a dispatch from CS-Cart
{if $smarty.request.dispatch == 'index.index'}
## Grabbing user group from CS-Cart
{$auth.usergroup_ids[2]}
## Admin user condition from CS-Cart
## $_SESSION prob isnt available, so $auth works instead
{if $auth.user_id && $auth.user_type == 'A'}
@dhaupin
dhaupin / dev_cli_cpanel_update_hooks.txt
Created April 28, 2017 15:03
Example - WHM/cPanel Update Hooks
# https://documentation.cpanel.net/display/SDK/Guide+to+Standardized+Hooks+-+The+manage_hooks+Utility
# To add a script to upcp schema (as a hook)
/usr/local/cpanel/bin/manage_hooks add script /root/src/cpanel-hooks/postupcp.sh --manual --category System --event upcp --stage post
# To remove a script as hook from upcp schema
/usr/local/cpanel/bin/manage_hooks delete script /root/src/cpanel-hooks/postupcp.sh --manual --category System --event upcp --stage post
# To list current hooks (
/usr/local/cpanel/bin/manage_hooks list