Skip to content

Instantly share code, notes, and snippets.

@phortuin
phortuin / signing-git-commits.md
Last active May 5, 2024 12:33
Set up a GPG key for signing Git commits on MacOS (M1)

Based on this blogpost.

To sign Git commits, you need a gpg key. GPG stands for GNU Privacy Guard and is the de facto implementation of the OpenPGP message format. PGP stands for ‘Pretty Good Privacy’ and is a standard to sign and encrypt messages.

Setting up

Install with Homebrew:

$ brew install gpg
@thienha1
thienha1 / Absolute Enable Right Click & Copy.user.js
Created April 25, 2021 15:16
Absolute Enable Right Click & Copy.user.js
// ==UserScript==
// @name Absolute Enable Right Click & Copy
// @namespace Absolute Right Click
// @description Force Enable Right Click & Copy & Highlight
// @shortcutKeys [Ctrl + `] Activate Absolute Right Click Mode To Force Remove Any Type Of Protection
// @author Absolute
// @version 1.8.9
// @include *://*
// @icon https://i.imgur.com/AC7SyUr.png
// @compatible Chrome Google Chrome + Tampermonkey
@trey8611
trey8611 / import-optimizations.md
Last active April 17, 2024 17:40
WP All Import - Optimize your import speed.
@Bajena
Bajena / Oauth.gs
Created June 23, 2018 19:16
Google script functions for performing simple Spotify Oauth flow
var oauth = {};
/** @const */
oauth.OAUTH_CLIENT_ID = 'OAUTH_CLIENT_ID';
/** @const */
oauth.OAUTH_CLIENT_SECRET = 'OAUTH_CLIENT_SECRET';
/**
* This builds an OAuth2 service for connecting to Spotify
@woogists
woogists / wc-query-woocommerce-active.php
Last active March 1, 2023 14:02
[Theming Snippets] Query whether WooCommerce is activated
/**
* Check if WooCommerce is activated
*/
if ( ! function_exists( 'is_woocommerce_activated' ) ) {
function is_woocommerce_activated() {
if ( class_exists( 'woocommerce' ) ) { return true; } else { return false; }
}
}
@woogists
woogists / wc-view-log-setting-snippet.php
Last active December 3, 2019 21:09
[Extending][WooCommerce Plugin Developer Handbook] log WooCommerce data that can be useful for debugging purposes.
$label = __( 'Enable Logging', 'your-textdomain-here' );
$description = __( 'Enable the logging of errors.', 'your-textdomain-here' );
if ( defined( 'WC_LOG_DIR' ) ) {
$log_url = add_query_arg( 'tab', 'logs', add_query_arg( 'page', 'wc-status', admin_url( 'admin.php' ) ) );
$log_key = 'your-plugin-slug-here-' . sanitize_file_name( wp_hash( 'your-plugin-slug-here' ) ) . '-log';
$log_url = add_query_arg( 'log_file', $log_key, $log_url );
$label .= ' | ' . sprintf( __( '%1$sView Log%2$s', 'your-textdomain-here' ), '<a href="' . esc_url( $log_url ) . '">', '</a>' );
}
@max-kk
max-kk / woocommerce_orders_bulk_actions.php
Last active December 1, 2017 16:39
Add Bulk actions to Woocommerce products list
<?php
/**
* PHP 5.3 and WP 4.7 is required
*/
//apply_filters( "bulk_actions-{$this->screen->id}", $this->_actions );
// Add our actions to list
add_filter( "bulk_actions-edit-shop_order", function($actions) {
@codemonkey-jack
codemonkey-jack / no-products-found-text.php
Last active December 12, 2017 20:01
Changes the no products found text in WooCommerce
<?php
function x_no_products_found_text( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'No products were found matching your selection.' :
$translated_text = __( 'Your Custom Text here', 'woocommerce' );
break;
}
return $translated_text;
}

Keybase proof

I hereby claim:

  • I am icanhasjonas on github.
  • I am icanhasjonas (https://keybase.io/icanhasjonas) on keybase.
  • I have a public key whose fingerprint is 353F 2B54 41B3 0DA8 69E8 EBCD 4A32 C3CB AC9D CC54

To claim this, I am signing this object:

@bekarice
bekarice / wc-prevent-checkout-for-cart-with-specific-category.php
Last active June 29, 2023 20:32
Prevents checkout if the WooCommerce cart only contains items from a specific category
<?php // only copy this line if needed
/**
* Renders a notice and prevents checkout if the cart
* only contains products in a specific category
*/
function sv_wc_prevent_checkout_for_category() {
// set the slug of the category for which we disallow checkout
$category = 'clothing';