Skip to content

Instantly share code, notes, and snippets.

View egorleet's full-sized avatar
🕊️
Peace & kindness first

Egor Volchenko egorleet

🕊️
Peace & kindness first
View GitHub Profile
@egorleet
egorleet / gist:69c39ab72a509a9aa02a18b3f61a5318
Created December 17, 2025 06:12
Make zip by files name
bash -c 'set -euo pipefail; shopt -s nullglob; for png in *.png; do base="${png%.png}"; zipname="${base}.zip"; files=( "${base}".* ); (( ${#files[@]} > 0 )) || continue; rm -f "$zipname"; zip -q -9 "$zipname" "${files[@]}"; echo "✅ $zipname <- ${#files[@]} file(s)"; done'
@egorleet
egorleet / nginx.conf
Created October 13, 2025 11:25
Redirect from 404 to main page
error_page 404 = @redirect_to_home;
location @redirect_to_home {
return 301 https://$host;
}
@egorleet
egorleet / setQuantity.js
Last active October 31, 2025 07:46
Automatically updates the Steam Market sell quantity input with the available amount (e.g., PAYDAY 2)
/**
* 🧩 setQuantity.js
*
* Automatically sets the quantity for Steam Market Sell input.
*
* This script keeps the sell quantity input (#market_sell_quantity_input)
* synchronized with the available amount element (#market_sell_quantity_available_amt).
*
* How it works:
* - Checks every millisecond if the quantity input is visible.
@egorleet
egorleet / find-external-links.php
Created October 2, 2025 03:24
External Links Audit for WordPress (posts & pages, Polylang compatible)
@egorleet
egorleet / wp-enable-comments-bulk.php
Last active September 23, 2025 13:54
Bulk script to enable comments (set comment_status = open) on all WordPress posts and pages.
<?php
$args = [
'posts_per_page' => -1,
'post_type' => ['page', 'post'],
'lang' => 'all', // Polylang posts
'suppress_filters' => false
];
$query = new WP_Query($args);
if ($query->have_posts()) {
while ($query->have_posts()) {
@egorleet
egorleet / header.php
Last active September 23, 2025 11:09
Set html-lang for front-page
<?php if (str_contains(home_url(),'million.tools')): ?>
<?php if (is_front_page()): ?>
<html lang="es">
<?php else: ?>
<html lang="<?=get_bloginfo('language')?>">
<?php endif;?>
<?php endif; ?>
<head>
<!-- ... -->
<?php if (str_contains(home_url(),'million.tools')) : ?>
@egorleet
egorleet / auto-delay-wysiwyg-acf.php
Last active September 22, 2025 16:28
Partial bug fix: When editing any block in Gutenberg, the cursor automatically jumps to the WYSIWYG field inside the ACF block.
<?php
/**
* Plugin Name: ACF WYSIWYG Auto-Delay (MU)
* Description: Sets delay = 1 for all ACF WYSIWYG fields.
* Author: Egor Volchenko • www.egor.im
*/
add_filter('acf/validate_field/type=wysiwyg', function ($field) {
$field['delay'] = 1;
return $field;
@egorleet
egorleet / steam-market-buy-order-scraper.js
Last active September 18, 2025 23:26
Steam Market Buy Order Scraper - Checks for Buy Orders at a Specified Price
// Steam Market Buy Order Scraper
// Author: Egor Volchenko • www.egor.im
// With assistance from Grok, created by xAI
// Description: This script scrapes Steam Market listings, extracts item_nameid, and checks for buy orders at a specified price in the desired currency.
// Results are displayed in a div after .market_search_results_header, with missing orders highlighted in red.
// Usage: Run in browser console on a Steam Market search page (e.g., https://steamcommunity.com/market/search?appid=730).
// Note: Requires Steam login for steamLoginSecure cookie. Use with caution to avoid rate limits.
const currencies = [
{ code: 1, name: 'USD / United States Dollar ($)' },
@egorleet
egorleet / wp-add-bulk-comments.php
Created September 18, 2025 20:35
Bulk insert predefined comments into WordPress posts and pages
<?php
/**
* Bulk insert predefined comments into WordPress posts and pages.
* Supports Polylang homepages, random authors and dates.
*
* Usage: add ?add_comments=1 to URL while logged in as admin.
* Author: www.egor.im
* Created: 2025-09-18
*/
@egorleet
egorleet / wp-config.php
Last active September 16, 2025 12:31
Disables WP Cache for a specific domain
<?php
if (isset($_SERVER['HTTP_HOST']) && in_array($_SERVER['HTTP_HOST'], ['million.tools', 'www.million.tools'], true)) {
define('DONOTCACHEPAGE', true);
define('DONOTCACHEOBJECT', true);
define('DONOTCACHEDB', true);
define('DONOTROCKETOPTIMIZE', true);
define( 'WP_CACHE', false );
} else {
define( 'WP_CACHE', true );
}