Skip to content

Instantly share code, notes, and snippets.

View lordspace's full-sized avatar

Svetoslav Marinov lordspace

View GitHub Profile
@lordspace
lordspace / openssl.cnf
Created May 7, 2019 12:50
This file is from Apache installation and it's referenced by this tutorial : How to Generate Certificate Authority (CA) Key and SSL Certificate with OpenSSL at https://orbisius.com/4583
#
# OpenSSL example configuration file.
# This is mostly being used for generation of certificate requests.
#
# This definition stops the following lines choking if HOME isn't
# defined.
HOME = .
RANDFILE = $ENV::HOME/.rnd
@lordspace
lordspace / qs_blog675_grant_customizer_access.php
Last active February 14, 2021 16:46
How to Allow Non-Admin Users to Access WordPress Customizer. Check the latest version on the qSandbox - https://qsandbox.com/675
<?php
/**
* How to Allow Non-Admin Users to Access WordPress Customizer. Published on the qSandbox - https://qsandbox.com/675
* <a href="https://qsandbox.com/?utm_source=qs_blog_code&utm_medium=p675" title="Free Test/Staging WordPress site by qSandbox.com">Free Test/Staging WordPress site by qSandbox.com</a>
* @param array $all_caps
* @param array $cap
* @param array $args
* @return array array
* @see https://codex.wordpress.org/Plugin_API/Filter_Reference/user_has_cap
@lordspace
lordspace / r-debug.php
Created September 8, 2021 20:31 — forked from Rarst/r-debug.php
R Debug (set of dump helpers for debug)
<?php
/*
Plugin Name: R Debug
Description: Set of dump helpers for debug.
Author: Andrey "Rarst" Savchenko
Author URI: https://www.rarst.net/ | https://gist.github.com/Rarst/1739714
License: MIT
*/
@lordspace
lordspace / woo-subscr-fix.php
Created November 4, 2023 15:03
fix for https://github.com/Automattic/woocommerce-subscriptions-core/ Site crashes with out of memory error when adding a downloadable product and hitting Update button
// file:
///plugins/woocommerce-subscriptions/vendor/woocommerce/subscriptions-core/includes/class-wcs-download-handler.php
/**
* Grant downloadable file access to any newly added files on any existing subscriptions
* which don't have existing permissions pre WC3.0 and all subscriptions post WC3.0.
*
* @param int $product_id
* @param int $variation_id
* @param array $downloadable_files product downloadable files