Skip to content

Instantly share code, notes, and snippets.

@agusmu
agusmu / functions1a.php
Last active August 25, 2023 04:36
Customize WooCommerce Categories & Tags Label
/* Customize Product Categories Labels */
add_filter( 'woocommerce_taxonomy_args_product_cat', 'custom_wc_taxonomy_args_product_cat' );
function custom_wc_taxonomy_args_product_cat( $args ) {
$args['label'] = __( 'Product Categories', 'woocommerce' );
$args['labels'] = array(
'name' => __( 'Product Categories', 'woocommerce' ),
'singular_name' => __( 'Product Category', 'woocommerce' ),
'menu_name' => _x( 'Categories', 'Admin menu name', 'woocommerce' ),
'search_items' => __( 'Search Product Categories', 'woocommerce' ),
'all_items' => __( 'All Product Categories', 'woocommerce' ),
@agusmu
agusmu / functions.php
Created August 19, 2013 04:35
WooCommerce - Show navigation on the top of shop page
/* Show pagination on the top of shop page */
add_action( 'woocommerce_before_shop_loop', 'woocommerce_pagination', 10 );
/* Remove pagination on the bottom of shop page */
remove_action( 'woocommerce_after_shop_loop', 'woocommerce_pagination', 10 );
@agusmu
agusmu / functions.php
Created December 23, 2022 04:08
WooCommerce Enable Legacy Paypal Standards Gateway
add_filter( 'woocommerce_should_load_paypal_standard', '__return_true' );
@agusmu
agusmu / supported_chars.php
Created October 12, 2022 10:17 — forked from ErikKalkoken/supported_chars.php
Simple script that checks if all characters of a given string are supported by OTF / TTF font and outputs the findings in a simple HTML table.
<?php
/**
* Checks if all characters of a given string are supported by OTF file
* Outputs the findings in a simple HTML table
*
* Needs: php-font-lib @ https://github.com/PhenX/php-font-lib
*/
require_once "../src/FontLib/Autoloader.php";
@agusmu
agusmu / NOTES.md
Created February 11, 2022 11:22 — forked from fatso83/NOTES.md
Installing Vagrant on Apple Silicon Macs (M1, M1X, etc)

VirtualBox only supports the x86 platform, so the default installation instructions for Vagrant does not work on Apple silicon. Thankfully Vagrant has a VMWare Provider (more on providers here), and so if I can get VMWare running on my M1 MacBook, I should be able to run Vagrant as well!

These are my notes during figuring this out.

Get the VMWare Tech Preview released in September 2021!

We are in luck, as VMWare released this just a few weeks ago.

  • See [their blog entry][1]
@agusmu
agusmu / vagrant-vmware-tech-preview-apple-m1-pro.md
Created February 11, 2022 11:22 — forked from sbailliez/vagrant-vmware-tech-preview-apple-m1-pro.md
Vagrant and VMWare Tech Preview on Apple M1 Pro

Vagrant and VMWare Tech Preview on Apple M1 Pro

This document summarizes notes taken while to make the VMWare Tech preview work on Apple M1 Pro, it originated from discussions in hashicorp/vagrant-vmware-desktop#22

Installing Rosetta

First install Rosetta if not already done, this is needed to run x86 code:

@agusmu
agusmu / runcloud-cronjob.md
Created February 10, 2022 00:23
How to prevent direct access to a cron job file in RunCloud

How to prevent direct access to a cron job file in RunCloud

Lets say I have created one php cron job file mycron.php with this content

<?php 

// my cron function start here
echo "yea! my cron is running \n";
@agusmu
agusmu / runcloud-dns_get_record.md
Created February 9, 2022 11:58
How to fix dns_get_record php function in RunCloud

How to fix dns_get_record php function in RunCloud

When using dns_get_record with DNS_ANY or DNS_ALL, it does not work with this warning message.

php -r "var_dump(dns_get_record('google.com', DNS_ANY));"
PHP Warning:  dns_get_record(): A temporary server error occurred. in Command line code on line 1
bool(false)
@agusmu
agusmu / runcloud-browscap.md
Last active February 9, 2022 04:26
How to setup browscap (get_browser php function) in RunCloud

How to setup browscap (get_browser php function) in RunCloud

First, login to your server from terminal using root

ssh root@YOUR_IP_ADDRESS

Second, run this command to download the browscap file

@agusmu
agusmu / wordpress-valet-install.md
Created December 23, 2021 09:59 — forked from orumad/wordpress-valet-install.md
How to install Wordpress from command line in Valet

How to install Wordpress from command line in Valet

I use Valet as my local web development environment (PHP, Laravel, Wordpress, ...)

This gist is my own recipe to install Wordpress from the command line to use it with Valet. Maybe this is useful for you too.

Install 'WP-CLI' command line tool