Skip to content

Instantly share code, notes, and snippets.

View hellerbenjamin's full-sized avatar

Benjamin Heller hellerbenjamin

View GitHub Profile
@hellerbenjamin
hellerbenjamin / index.js
Created July 23, 2021 16:30
Nuxt add middleware from module
const path = require('path')
export default function plugins(_moduleOptions) {
this.nuxt.hook('build:templates', ({ templateVars }) => {
templateVars.middleware.push({
name: 'authenticated',
src: path.resolve(__dirname, 'middleware/authenticated.js'),
fileName: path.join('authenticated.js'),
add_action( 'wp_head', function() {
?>
<link rel="preload" href="" as="font" type="font/woff2" />
<?php
} );
@hellerbenjamin
hellerbenjamin / snippets.php
Created December 21, 2020 02:01
Guzzle untruncted error message
$exception->getResponse()->getBody()->getContents();
@hellerbenjamin
hellerbenjamin / gist:b2f20963f93ac394a840c4aa2d57ba42
Last active October 7, 2023 07:49
Woocommerce Subscriptions WP CLI cheatsheet
Woocommerce Subscription WP CLI Cheatsheet
Reviews
Enable Reviews on all
wp db query 'UPDATE wp_posts SET comment_status="open" WHERE post_type="product" AND comment_status="closed"'
Query disabled reviews
wp db query 'SELECT ID FROM wp_posts WHERE post_type="product" AND comment_status="closed" AND post_status="publish"'
@hellerbenjamin
hellerbenjamin / gist:96479c59ae65a4e445a50f15b5f1c464
Created October 26, 2017 02:41
CloudFlare WordPress Page rules for dashboard
*.site.com/*&preview=true
*.site.com/wp-login.php*
*.site.com/wp-admin*
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} =on
RewriteCond %{HTTP_HOST} ^benjaminheller.net
# Start WPFC Exclude
# End WPFC Exclude
# Start_WPFC_Exclude_Admin_Cookie
RewriteCond %{HTTP:Cookie} !wordpress_logged_in_[^\=]+\=benheller
@hellerbenjamin
hellerbenjamin / 0_reuse_code.js
Created September 27, 2016 21:53
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console