Skip to content

Instantly share code, notes, and snippets.

@shameemreza
shameemreza / add-gtin-to-quick-edit.php
Created December 8, 2025 10:52
Adds a GTIN field to the WooCommerce Quick Edit panel, allowing store managers to view and update GTIN values directly from the product list
/**
* Add GTIN Field to WooCommerce Quick Edit Panel
*
* Allows viewing and editing GTIN from the Quick Edit dropdown.
*/
/**
* Get the GTIN field label (same as product settings).
*
* @return string
@davekobrenski
davekobrenski / convert.sh
Last active August 7, 2026 15:17
Batch Optimize Videos for WEB with FFmpeg
#!/bin/sh
# colors
green='\033[0;32m'
purple='\033[0;35m'
cyan='\033[0;36m'
yellow='\033[0;33m'
clear='\033[0m'
# loop through immediate subdirectories
@shameemreza
shameemreza / woocommerce_saudi_kuwait_states.php
Created February 5, 2025 09:50 — forked from DevWael/woocommerce_saudi_kuwait_states.php
add saudi arabia and kuwait states to woocommerce
<?php
add_filter( 'woocommerce_states', 'dw_woocommerce_states' );
function dw_woocommerce_states( $states ) {
$states['KW'] = array(
'KWQ' => __('Dasmān','porto'),
'KWA' => __('Sharq','porto'),
'KWZ' => __('Mirgāb','porto'),
'KWW' => __('Jibla','porto'),
@rmpel
rmpel / class-uploads.php
Last active September 18, 2025 23:32
The definitive way to add more filetypes to WordPress Media.
<?php
/**
* Filters that assist in uploading additional filetypes.
*
* @package Your_Package
* @subpackage Your_Package/Includes
*/
namespace Your_Package\Includes;
@stokesman
stokesman / vite.config.js
Created October 24, 2023 18:56
Rudimentary Vite config that builds with WordPress dependency extraction
import { createHash } from 'crypto'
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import {
defaultRequestToExternal,
defaultRequestToHandle
} from '@wordpress/dependency-extraction-webpack-plugin/lib/util.js'
import json2php from 'json2php'
import packageMeta from './package.json';
@Gictorbit
Gictorbit / allpersiangirlnames.md
Created May 25, 2023 17:58
all persian girl names

آ

آبانا آباندخت آبگین آبگینه آبنوس آبین آبینه آپام آپاما

@Gictorbit
Gictorbit / allperianboynames.md
Created May 25, 2023 16:44
all persian boy names

آ

آبان آبتين آپتين آتا آتبين آتريداد آتمين آتور آتيلا

<?php
/*
OpenStreetMap GeoHash generator and direct link generator
Usage examples:
OsmGeoHash\getHash(40.689167, -74.044444, 13) -> returns "Zctz1Jf"
OsmGeoHash\getLink(40.689167, -74.044444, 13) -> returns "https://osm.org/go/Zctz1Jf?m="
@thewebartisan7
thewebartisan7 / valid-attributes.js
Last active May 20, 2025 01:40
All valid HTML attributes by element
/**
* List of valid HTML attributes that will be passed to first node of component or
* to the node with an attribute 'attributes'.
* Generated from https://www.w3.org/TR/html4/index/attributes.html
*
* @see https://jsfiddle.net/1r8czt2h/
*/
module.exports = {
elementAttributes: {
@ichim-david
ichim-david / gulp-cjs-to-esm.md
Created July 27, 2022 18:18 — forked from noraj/gulp-cjs-to-esm.md
Moving gulpfile from CommonJS (CJS) to ECMAScript Modules (ESM)

Moving gulpfile from CommonJS (CJS) to ECMAScript Modules (ESM)

Context

del v7.0.0 moved to pure ESM (no dual support), which forced me to move my gulpfile to ESM to be able to continue to use del.

The author sindresorhus maintains a lot of npm packages and does not want to provides an upgrade guide for each package so he provided a generic guide. But this guide is a bit vague because it's generic and not helping for gulp, hence this guide.

Guide