Skip to content

Instantly share code, notes, and snippets.

@planetahuevo
planetahuevo / stripParamsWorker.js
Created January 5, 2021 23:23 — forked from rohenaz/stripParamsWorker.js
cloudflare worker - strip referral query parameters such as fbclid
/**
* Define regular expressions at top to have them precompiled.
*/
const urlRegex = new RegExp('^(refreshce|gclid|cx|ie|cof|siteurl|zanpid|origin|utm_[a-z]+|fbid|fbclid|mr:[A-z]+|ref(id|src))$');
addEventListener('fetch', event => {
event.passThroughOnException()
event.respondWith(handleRequest(event.request))
})
@planetahuevo
planetahuevo / hide-edd-coupons.php
Created November 10, 2020 17:01 — forked from bekarice/hide-edd-coupons.php
Hide EDD Coupon fields and codes at checkout
/**
* Snippets to hide EDD coupon fields & codes during the checkout process - handy if you use URLs to apply discounts instead
* Tutorial: http://www.sellwithwp.com/easy-digital-downloads-hide-coupons/
*/
// Removes the field to enter a discount at checkout
remove_action( 'edd_checkout_form_top', 'edd_discount_field', -1 );
// Changes the discount code in the checkout summary to display "Discount applied - " instead of the code
@planetahuevo
planetahuevo / cookie-policy.md
Created December 10, 2019 20:41 — forked from maddisondesigns/cookie-policy.md
eCommerce Terms & Conditions and Privacy Templates
@planetahuevo
planetahuevo / yuzo-related-post-hacked.md
Created April 10, 2019 12:34 — forked from mrnonz/yuzo-related-post-hacked.md
Zero Day Vulnerability Yuzo Related Post plugin. I try to find where injected code into my Database

SELECT * FROM wp_options WHERE option_value LIKE '%eval(String.fromCharCode%';

and I got these value.

@planetahuevo
planetahuevo / Price Breakdown.md
Created February 28, 2019 16:53 — forked from justjanne/Price Breakdown.md
Server Price Breakdown: DigitalOcean, Amazon AWS LightSail, Vultr, Linode, OVH, Hetzner, Scaleway/Online.net:

Server Price Breakdown: DigitalOcean, Amazon AWS LightSail, Vultr, Linode, OVH, Hetzner, Scaleway/Online.net:

Permalink: git.io/vps

$5/mo

Provider Type RAM Cores Storage Transfer Network Price
@planetahuevo
planetahuevo / custom-client-reports-tokens.php
Created January 3, 2019 17:45 — forked from bogdan-mainwp/custom-client-reports-tokens.php
Custom code snippet for creating custom tokens for the Client Reports Extension
<?php
// Add the following code snippet to the functions.php file of the MainWP Customisations plugin
// Download MainWP Customisations here: https://github.com/mainwp/mainwp-customisations
// More about the plugin: https://mainwp.com/mainwp-customisations/
// Create Custom Client Report tokens
add_filter( 'mainwp_client_reports_tokens_groups', 'mycustom_reports_tokens_groups' );
function mycustom_reports_tokens_groups( $tokens ) {
// examples
@planetahuevo
planetahuevo / bash_profile.sh
Created December 13, 2018 18:05 — forked from kjbrum/bash_profile.sh
My personal bash profile
#---------------------------------------------------------------------------------------------------------------------------------------
#
# Author: Kyle Brumm
# Description: File used to hold Bash configuration, aliases, functions, completions, etc...
#
# Sections:
# 1. ENVIRONMENT SETUP
# 2. MAKE TERMINAL BETTER
# 3. FOLDER MANAGEMENT
# 4. MISC ALIAS'
@planetahuevo
planetahuevo / .htaccess
Created October 9, 2018 17:05 — forked from Zodiac1978/.htaccess
Safer WordPress with these .htaccess additions
# Don't show errors which contain full path diclosure (FPD)
# Use that line only if PHP is installed as a module and not per CGI
# try using a php.ini in that case.
# Change mod_php5.c to mod_php7.c if you are running PHP7
<IfModule mod_php5.c>
php_flag display_errors Off
</IfModule>
# Don't list directories
<IfModule mod_autoindex.c>
@planetahuevo
planetahuevo / functions.php
Created October 2, 2018 17:15 — forked from nickcernis/functions.php
Genesis Simple Share Shortcode
<?php
// Adds a [social-icons] shortcode to output Genesis Simple Share icons in posts
// https://wordpress.org/plugins/genesis-simple-share/
// Add the code below to your active theme's functions.php file,
// or use in a site-specific plugin.
// The shortcode takes no attributes; change your icon settings via Genesis → Simple Share.
add_shortcode( 'social-icons', 'gss_shortcode' );
@planetahuevo
planetahuevo / mainwp-client-report-monthly.html
Created September 14, 2018 16:33 — forked from uamv/mainwp-client-report-monthly.html
HTML Text Used for MainWP Monthly Client Report
<table style="width: 600px; margin: 0 auto; padding: 0; border-spacing: 0; border-collapse: collapse;"><tbody><tr><td style="background: #040404; margin-top: 0; padding: 0;"><img style="display: block; border: 0; line-height: 1;" src="https://typewheel.xyz/share/typewheel-email-banner.png" alt="Typewheel" width="600" /></td></tr><tr><td style="padding: 2em; background-image: linear-gradient( to bottom, #D7D7D7, #E7D3BA);"><p style="margin: 0 2em 2em;">Hello [client.contact.nickname]! Here's an overview of the things I am doing to keep your site updated, optimized, and secure.</p><p style="text-align: center; margin: 0 0 1.5em;"><img style="display: block; margin: 0 auto .5em;" src="[client.logo.url]" alt="[client.name] Logo" height="100" /><span style="text-align: center; font-size: 28px;"><strong>[report.daterange]</strong></span><br /><span style="text-align: center; font-size: 28px;"><strong><a style="color: #040404; text-decoration: none;" href="[client.site.url]">[client.site.domain]</a></strong></span><