Skip to content

Instantly share code, notes, and snippets.

View bahiirwa's full-sized avatar
🏠
Working from home

Laurence Bahiirwa bahiirwa

🏠
Working from home
View GitHub Profile
@bahiirwa
bahiirwa / gist:f1830f5b16f22ac2bc52197cd84b9683
Created August 17, 2019 09:44 — forked from Marian0/gist:4d689c33164bc9daf0e1
Disable wordpress Frontend by htaccess
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !/wp-admin
RewriteCond %{REQUEST_URI} !/wp-includes
RewriteCond %{REQUEST_URI} !/wp-login\.php$
RewriteCond %{REQUEST_URI} !/wp-content
RewriteCond %{REQUEST_URI} !/feed
@bahiirwa
bahiirwa / woocommerce.php
Created November 27, 2019 08:25 — forked from zulfgani/woocommerce.php
WooCommerce Addons compatibility for ClassicPress
<?php
/**
* Plugin Name: Woo Addons Compatibility
* Plugin URI: https://github.com/zulfgani/woocommerce
* Description: A compatibility plugin for some WooCommerce addons to work with ClassicCommerce.
* Version: 10.0.1111
* Author: I have no idea
* Author URI: https://ihavenoideapleasedontquoteme.com
*
* @package Woo Addons Compatibility
@bahiirwa
bahiirwa / .htaccess
Created March 19, 2020 03:49 — forked from johnalarcon/.htaccess
Directives for the ClassicPress .htaccess file. These directives can be copied into your exisitng .htaccess file, but they are not intended to overwrite other directives that may already be present. Read the comment before each directive below, and you'll be fine!
# Code Potent's official .htaccess directives to make your ClassicPress site ROCK!
# Prevent directory browsing.
Options -Indexes
# Enable rewrite engine - you may already have these 2 lines... don't duplicate, if so.
RewriteEngine On
RewriteBase /
# Force SSL connection to everything (URLs, images, scripts, styles, etc)
<?php
/*
Plugin Name: Custom Registration Fields
Plugin URI:
Description:
Version: 0.1
Author: CSSIgniter
Author URI:
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
add_action( 'graphql_register_types', function() {
$mock_colors = '
{
"fresh":{
"name":"Default",
"url":false,
"colors":[
"#222",
"#333",
<?php
/**
* Make a remote GET using DIGEST authentication.
*
* DIGEST authenticated requests require two GET requests:
* 1. GET the www-authenticate header for nonce, realm, opaque, and other values
* 2. GET the expected response body by constructing an 'Authorization' header
* with nonce, realm, and other values provided by the server.
*
@bahiirwa
bahiirwa / example-wp-list-table.php
Created March 6, 2021 18:01 — forked from paulund/example-wp-list-table.php
An example code of using the WP_List_Table class. With Pagination.
<?php
/*
* Plugin Name: Paulund WP List Table Example
* Description: An example of how to use the WP_List_Table class to display data in your WordPress Admin area
* Plugin URI: http://www.paulund.co.uk
* Author: Paul Underwood
* Author URI: http://www.paulund.co.uk
* Version: 1.0
* License: GPL2
*/
@bahiirwa
bahiirwa / deploy.yml
Created May 10, 2022 06:26 — forked from hhhonzik/deploy.yml
Kinsta Deployment
# Kinsta Deployment through Github Actions for Bedrock/Sage.
#
# Placed at: .github/workflow/deploy.yml
#
# Process should be studied from code, but some quick brief:
# - runs composer / sage installation
# - moves correct `.env.*` file for multiple configs
# - uses rsync to sync files, uses /.rsyncignore file to exclude whatever should not be there
# - symlinks uploads folder and symlink release folder to kinsta public hostname
# - if you want to clear cache, please uncomment the last job
@bahiirwa
bahiirwa / php-block-styles.php
Created May 11, 2022 16:30 — forked from wpmark/php-block-styles.php
Register WordPress block styles with PHP
<?php
/**
* Register some default block editor styles for this block.
*/
function hd_testimonials_register_testimonials_block_styles() {
// add the small image style.
register_block_style(
'core/heading', // name of your block
array(
@bahiirwa
bahiirwa / OrdersList.php
Created June 3, 2022 06:26 — forked from devinsays/OrdersList.php
Speeds up the loading of /wp-admin/edit.php?post_type=shop_order and /wp-admin/edit.php?post_type=subscription.
<?php
namespace UniversalYums\Admin\Performance;
class OrdersList {
/**
* The single instance of the class.
*/
protected static $instance;