Skip to content

Instantly share code, notes, and snippets.

View vijayhardaha's full-sized avatar
💻
Working on WordPress

Vijay Hardaha vijayhardaha

💻
Working on WordPress
View GitHub Profile
@thealphadollar
thealphadollar / fb_accept_friends.js
Last active August 26, 2025 10:53
Script To Accept All Facebook Friend Requests
// If the script does not work, you may need to allow same site scripting https://stackoverflow.com/a/50902950
Facebook = {
config: {
actionDelay: 1000,
scrollDelay: 5000,
// set to -1 for no limit
maxRequestsToAccept: -1,
totalRequestsAccepted: 0,
// set string to be present in names to be accepted, leave empty to accept all
@qoomon
qoomon / conventional-commits-cheatsheet.md
Last active December 6, 2025 12:31
Conventional Commits Cheatsheet
@eSaner
eSaner / wp-cli_update_multi_posts.txt
Last active April 2, 2023 20:11
Update multiple posts with WP-CLI
/**
* Command line
*
* @source https://git.pub/snippets/4
*/
for id in $(wp post list --post_type=my_post_type --fields=ID --format=ids); do wp post update $id --post_title="Page Number $id"; done
@kreamweb
kreamweb / sort-cart-items-by-price.php
Last active September 12, 2022 22:31
Woocommerce - Sort cart items by price
add_action( 'woocommerce_cart_loaded_from_session', 'wpm_cart_order_items_by_price' );
function wpm_cart_order_items_by_price( $cart ) {
//if the cart is empty do nothing
if ( empty( $cart->cart_contents ) ) {
return;
}
//this is an array to collect cart items
@MikeNGarrett
MikeNGarrett / wp-config.php
Last active November 3, 2025 17:25
All those damned wp-config constants you can never remember.
<?php
// PHP memory limit for this site
define( 'WP_MEMORY_LIMIT', '128M' );
define( 'WP_MAX_MEMORY_LIMIT', '256M' ); // Increase admin-side memory limit.
// Database
define( 'WP_ALLOW_REPAIR', true ); // Allow WordPress to automatically repair your database.
define( 'DO_NOT_UPGRADE_GLOBAL_TABLES', true ); // Don't make database upgrades on global tables (like users)
// Explicitely setting url