Skip to content

Instantly share code, notes, and snippets.

View shameemreza's full-sized avatar
🦜
Talk is cheap. Check My Code, Blog and Portfolio.

Shameem Reza shameemreza

🦜
Talk is cheap. Check My Code, Blog and Portfolio.
View GitHub Profile
@malarkey
malarkey / Contract Killer 3.md
Last active April 16, 2024 21:44
The latest version of my ‘killer contract’ for web designers and developers

When times get tough and people get nasty, you’ll need more than a killer smile. You’ll need a killer contract.

Used by 1000s of designers and developers Clarify what’s expected on both sides Helps build great relationships between you and your clients Plain and simple, no legal jargon Customisable to suit your business Used on countless web projects since 2008

…………………………

@isaumya
isaumya / remove-woocommerce-bloat-marketing-hub.md
Last active April 10, 2024 12:45
Easily Remove WooCommerce Bloated Features like Marketing Hub from WordPress Admin Menu

Remove WooCommerce Bloated Features from WP Admin Menu

Recently WooCommerce has added a lot of improvements to the plugin which we really appriciate but at the same time a lot of bloated features has alos been added to the plugin like Marketing Hub, a completely useless menu taking extra space among the other important menu items. Now if you find Marketing Hub to be useful, you can keep it.

But just in case you are looking for a way to remove these features that you no longer need from your WordPress Admin menus, take a look at the following code snippets. Please note: though I will show you how you can remove the Marketing Hub from your WP Admin menu list completely and make sure WooCommerce doesn't execute codes for that feature you don't need, you can do the same for other WooCommerce features as well like Analytics.

How to remove Marketing Hub for WooCommerce <= v4.2

If you are using WooCommerce <= v4.2, you can simple add this one line of code in your theme's functions.php f

@cryptexvinci
cryptexvinci / remove_checkout_fields.php
Last active March 3, 2024 00:43
Remove fields from WooCommerce checkout page.
<?php
add_filter( 'woocommerce_checkout_fields' , 'custom_remove_woo_checkout_fields' );
function custom_remove_woo_checkout_fields( $fields ) {
// remove billing fields
unset($fields['billing']['billing_first_name']);
unset($fields['billing']['billing_last_name']);
unset($fields['billing']['billing_company']);
@pbrocks
pbrocks / install-phpcs-with-homebrew.md
Last active December 22, 2023 08:16
Install phpcs with Homebrew

Install phpcs with Homebrew

To set up php linting, you’ll want to install this PHP CodeSniffer repo and configure with this WordPress Coding Standards repo: . There are a number of ways to do this, whether direct download, Composer, Homebrew, Pear, etc. The following is what works for me on MacOS using Homebrew:

In a terminal window on your Mac, start by updating your Homebrew.

brew doctor

Then install the Code Sniffer:

@remcotolsma
remcotolsma / README.md
Last active December 21, 2023 14:13
WordPress development environment on Mac with Brew, Nginx, PHP 7, PHP-FPM, MariaDB, phpMyAdmin and more

WordPress development environment on Mac with Brew, Nginx, PHP 7, PHP-FPM, MariaDB, phpMyAdmin and more

Brew

http://brew.sh/

brew tap homebrew/dupes
brew tap homebrew/versions
brew tap homebrew/homebrew-php
@keithmorris
keithmorris / .htaccess
Created June 30, 2012 12:09
CodeIgniter .htaccess file
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
#Removes access to the system folder by users.
#Additionally this will allow you to create a System.php controller,
#previously this would not have been possible.
#'system' can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
@jaredatch
jaredatch / custom-validation.js
Last active September 7, 2023 15:45
WPForms adding a custom validation rule
;(function($) {
var JA_Custom_Validation = {
/**
* Start the engine.
*
* @since 1.0.0
*/
init: function() {
@ravahdati
ravahdati / convert-wp-image-to-base64.php
Last active January 20, 2021 14:09
Convert WordPress image to base64 by attach_id
<?php
function tidaweb_image_url_to_base64( $attach_id )
{
// get image src -> $image_info[0]
$image_info = wp_get_attachment_image_src( $attach_id, 'full' );
$image_file = file_get_contents( $image_info[0] );
// get filename from url
$filename = basename( get_attached_file( $attach_id ) );
$image_file_type = wp_check_filetype( $filename );
@amrishodiq
amrishodiq / Lbs.php
Created April 2, 2012 07:57
PHP Code Igniter library class to get latitude & longitude, get address for specified latitude & longitude, get direction from one place to another place, and so on. Most LBS concept I implemented with PHP.
<?php
/**
* Written by Amri Shodiq.
* Do not hesitate to copy and paste this code.
* It's not embarassing.
*/
if (!defined('BASEPATH'))
exit ('No direct script access allowed');
@DustonMcGroarty
DustonMcGroarty / genesis-sales-page.php
Last active July 14, 2019 20:46
Genesis Sales Page Template
<?php
/*
Template Name: Sales Page
*/
//* Add custom body class to the head
add_filter( 'body_class', 'dm_add_body_class' );
function dm_add_body_class( $classes ) {
$classes[] = 'dm-sales';