Skip to content

Instantly share code, notes, and snippets.

@ljube
ljube / functions.php
Created January 21, 2025 22:38 — forked from tripflex/functions.php
How to add additional email addresses when email is sent to WordPress admin_email option value
<?php
/**
*
* WARNING: this only checks if the email is being sent to the same email as admin_email option.
* If for some reason another email is sent to that same email address, but it's not meant as an "admin email"
* this filter will still add those additional emails, just something to keep in mind.
*/
add_filter( 'wp_mail', 'my_custom_to_admin_emails' );
@ljube
ljube / website-dl.md
Created February 19, 2023 16:37 — forked from stvhwrd/website-dl.md
Download an entire website for offline use with wget. Internal inks will be corrected so that the entire downloaded site will work as it did online.

The best way to download a website for offline use, using wget

There are two ways - the first way is just one command run plainly in front of you; the second one runs in the background and in a different instance so you can get out of your ssh session and it will continue.

First make a folder to download the websites to and begin your downloading: (note if downloading www.SOME_WEBSITE.com, you will get a folder like this: /websitedl/www.SOME_WEBSITE.com/)


STEP 1:

@ljube
ljube / yoast_seo_breadcrumb_remove_link.php
Created August 14, 2022 09:20 — forked from amboutwe/yoast_seo_breadcrumb_remove_link.php
These snippets are examples of how you can modify the Yoast SEO breadcrumb visual output. These snippets will not alter the breadcrumb schema output. Please consult the schema documentation to change the breadcrumb schema: https://developer.yoast.com/features/schema/api#to-add-or-remove-graph-pieces
@ljube
ljube / borica_response.php
Created September 15, 2021 13:22 — forked from dimitarminchev/borica_response.php
Borica Response 2.3
<?php
/*
# Borica Responce 2.3
Получаване и обработка на отговор от електронно плащане: [borica_response.php](https://gist.github.com/dimitarminchev/34265c2c780ccff86a545eb4a1ffd88c)
- Автор: [доц. д-р Димитър Минчев](http://www.minchev.eu)
- Eлектронна поща: [[email protected]](mailto:[email protected])
## Документация
- [Borica APGW e-Gateway Resources](https://3dsgate-dev.borica.bg/)
- [APGW e-Commerce CGI Interface for Virtual Merchants](https://3dsgate-dev.borica.bg/P-OM-41_BORICA_eCommerce_CGI_interface_v2.3.pdf)
@ljube
ljube / borica_request.php
Created September 15, 2021 13:21 — forked from dimitarminchev/borica_request.php
Borica Request 2.3
<?php
/*
# Borica Request 2.3
Изпращане на заявка за извършване на електронно плащане: [borica_request.php](https://gist.github.com/dimitarminchev/08d8ab833fa481a8cc5c1e365a16c05e)
- Автор: [доц. д-р Димитър Минчев](http://www.minchev.eu)
- Eлектронна поща: [[email protected]](mailto:[email protected])
## Документация
- [Borica APGW e-Gateway Resources](https://3dsgate-dev.borica.bg/)
- [APGW e-Commerce CGI Interface for Virtual Merchants](https://3dsgate-dev.borica.bg/P-OM-41_BORICA_eCommerce_CGI_interface_v2.3.pdf)
@ljube
ljube / polylang-bulk-translate.php
Created March 29, 2021 22:52 — forked from tnottu/polylang-bulk-translate.php
WP Polylang Bulk Translate
<?php
/*
Plugin Name: Polylang Bulk Translate
Plugin URI:
Version: 0.1.0
Author: Tyomaa Oy
Author URI: https://github.com/tnottu
Description: Translate multiple posts with bulk actions
License: GPLv2 or later
@ljube
ljube / hosts
Created February 18, 2021 15:18 — forked from consti/hosts
/etc/hosts to block shock sites etc.
# This hosts file is brought to you by Dan Pollock and can be found at
# http://someonewhocares.org/hosts/
# You are free to copy and distribute this file for non-commercial uses,
# as long the original URL and attribution is included.
#<localhost>
127.0.0.1 localhost
127.0.0.1 localhost.localdomain
255.255.255.255 broadcasthost
::1 localhost
@ljube
ljube / gist:6b5fadfc2d8bbd63d18d4e6576636676
Created December 23, 2020 23:52 — forked from codler/gist:3906826
Support HTTP Header Range, mp4, php.php/mp4.mp4
<?php
# Nginx don't have PATH_INFO
if (!isset($_SERVER['PATH_INFO'])) {
$_SERVER['PATH_INFO'] = substr($_SERVER["ORIG_SCRIPT_FILENAME"], strlen($_SERVER["SCRIPT_FILENAME"]));
}
$request = substr($_SERVER['PATH_INFO'], 1);
$file = $request;
$fp = @fopen($file, 'rb');
@ljube
ljube / VideoStream.php
Created December 22, 2020 19:18 — forked from ranacseruet/VideoStream.php
PHP VideoStream class for HTML5 video streaming
<?php
/**
* Description of VideoStream
*
* @author Rana
* @link http://codesamplez.com/programming/php-html5-video-streaming-tutorial
*/
class VideoStream
{
private $path = "";
@ljube
ljube / add-required-attribute.js
Created December 15, 2020 10:16 — forked from damiencarbery/add-required-attribute.js
Make the 'Weight' field required in WooCommerce Edit Product page.
jQuery(document).ready(function(jQuery){
$('#_weight').prop('required',true); // Set weight field as required.
});