Skip to content

Instantly share code, notes, and snippets.

View Preciousomonze's full-sized avatar
🤡
Coding on the bicycle 😎🚴🏽‍♂️

Precious Omonzejele Preciousomonze

🤡
Coding on the bicycle 😎🚴🏽‍♂️
View GitHub Profile
@helgatheviking
helgatheviking / wc-fgc-sync.php
Created March 25, 2019 13:38
Sync the quantity of the Free Gift product to the quantity of a required purchased product
<?php
/**
* Plugin Name: WooCommerce Free Gift Coupons: Sync to Required Products
* Plugin URI: http://www.woocommerce.com/products/free-gift-coupons/
* Description: Sync the quantity of the Free Gift product to the quantity of a required purchased product
* Version: 1.0.0.beta.1
* Author: Kathy Darling
* Author URI: http://kathyisawesome.com
* Requires at least: 4.4
* Tested up to: 5.1.0
@premitheme
premitheme / README.md
Last active February 11, 2025 18:15
Generate POT file for WP themes and plugins on Mac

Generate POT file

1. Install gettext GNU tools with Homebrew using Terminal

  1. Install Homebrew: Install Homebrew : /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  2. Install GNU gettext: brew install gettext
  3. Then you must add that package to your path: echo 'export PATH="/usr/local/opt/gettext/bin:$PATH"' >> ~/.bash_profile
  4. Restart your computer! (Otherwise you will get "sh: msguniq: command not found" error).
@joshuawoodward
joshuawoodward / signature.php
Created August 2, 2017 19:04
How to generate a signature for zoom in PHP
/**
* Generate signature for ZoomMtg JSSDK.
*
* @param string $api_key You REST API Key
* @param string $api_secret You REST API Secret
* @param int $meeting_number The meeting number you are creating the signature for
* @param int $role Role that this signature is for; 0 for participant, 1 for host
*
* @return string Returns the signature string
*
@mofesolapaul
mofesolapaul / nigeria-states-and-local-govts.json
Last active March 24, 2025 23:35
Json array containing objects of each Nigerian state, and their local governments
[
{
"state": "Abia",
"lgas": [
"Aba North",
"Aba South",
"Arochukwu",
"Bende",
"Ikawuno",
"Ikwuano",
@rynaldos-zz
rynaldos-zz / wc-no-links-thumbnails.php
Last active March 20, 2021 02:24
[WooCommerce 3.0+] Remove links from single product image thumbnails
@sybrew
sybrew / remove-woocommerce-message-part.php
Last active October 15, 2021 05:24
Removes "Continue Shopping" message from WooCommerce after item has been added to cart.
<?php
\add_filter( 'wc_add_to_cart_message', function( $string, $product_id = 0 ) {
$start = strpos( $string, '<a href=' ) ?: 0;
$end = strpos( $string, '</a>', $start ) ?: 0;
return substr( $string, $end ) ?: $string;
} );
@knowbody
knowbody / RNfontWeights.js
Created July 14, 2016 13:42
React Native Font Weight Cheatsheet iOS
{ fontWeight: '100' }, // Thin
{ fontWeight: '200' }, // Ultra Light
{ fontWeight: '300' }, // Light
{ fontWeight: '400' }, // Regular
{ fontWeight: '500' }, // Medium
{ fontWeight: '600' }, // Semibold
{ fontWeight: '700' }, // Bold
{ fontWeight: '800' }, // Heavy
{ fontWeight: '900' }, // Black
@tripflex
tripflex / functions.php
Last active March 19, 2025 11:59
WordPress Remove Filter (remove_filter converted to remove_class_filter) to remove Filter/Action without Class Object access. Works with WordPress 1.2+ (4.7+ support added 9-19-2016)
<?php
/**
* Make sure the function does not exist before defining it
*/
if( ! function_exists( 'remove_class_filter' ) ){
/**
* Remove Class Filter Without Access to Class Object
*
* In order to use the core WordPress remove_filter() on a filter added with the callback
@strangerstudios
strangerstudios / nextlastpayments.php
Last active August 31, 2021 21:21
Add last payment date and next payment date to the members list and export CSV in Paid Memberships Pro (PMPro)
/*
Add last paymenet date and next payment date to the members list and export CSV
Add this code into a custom plugin or your active theme's functions.php.
Note that "last payment" value will get the last order in "success", "cancelled", or "" status.
(Oddly enough, cancelled here means that the membership was cancelled, not the order.)
The "next payment" value is an estimate based on the billing cycle of the subscription and the last order date.
It may be off form the actual recurring date set at the gateway, especially if the subscription was updated at the gateway.
@yvele
yvele / get-npm-package-version.sh
Last active April 27, 2024 04:19
Extract version from package.json (NPM) using bash / shell
# Version key/value should be on his own line
PACKAGE_VERSION=$(cat package.json \
| grep version \
| head -1 \
| awk -F: '{ print $2 }' \
| sed 's/[",]//g' \
| tr -d '[[:space:]]')
echo $PACKAGE_VERSION