Skip to content

Instantly share code, notes, and snippets.

View qant's full-sized avatar
💫
Permanent study state

Anton qant

💫
Permanent study state
  • lusa realty, lusa legal, banisio
  • Испания
  • X @antseme
View GitHub Profile
@qant
qant / function.php
Created July 27, 2023 06:57 — forked from szelag-michal/function.php
Woocommerce Mini Cart
//Override woocommerce product categories widgets
add_action( 'widgets_init', 'floweb_override_woocommerce_widgets', 15 );
function floweb_override_woocommerce_widgets() {
// Ensure our parent class exists to avoid fatal error
if ( class_exists( 'WC_Widget_Cart' ) ) {
unregister_widget( 'WC_Widget_Cart' );
require get_template_directory() . '/functions/custom-widgets/floweb-class-wc-widget-cart.php';
register_widget( 'Floweb_WC_Widget_Cart' );
}
}
@qant
qant / dl.bat
Created July 9, 2023 14:20
Download youtube video using yt-dlp.exe and ffmpeg.exe
@echo off
cd g:\DL\
rem .\yt-dlp.exe -S 'res:4320s' -f "bv*" "%2" --extractor-args "youtube:player_client=android"
rem -S 'res:4320s' 20
rem bv*[ext=mp4]
rem "bv*+ba/b"
.\yt-dlp.exe -f "bv*+mergeall[vcodec=none]" "%2"
rem .\yt-dlp.exe -f "ba/b" "%2"
rem bv*+ba/b
rem .\yt-dlp.exe -J "bv*" "%2" --extractor-args "youtube:player_client=android" > json.txt
@qant
qant / ffmpeg.php
Created July 9, 2023 14:06
ffmpeg bulk video decoder
<?php
$inputFolder = '/path';
$outputFolder = '/path_output';
$files = glob($inputFolder . '/*');
foreach ($files as $file) {
$filename = pathinfo($file, PATHINFO_FILENAME);
@qant
qant / 01_enhanced_ecommerce_plugin.js
Created July 5, 2023 18:39 — forked from OrenBochman/01_enhanced_ecommerce_plugin.js
Enhanced ecommerce snippets in universal analytics
//This command must occur after you create your tracker object and before you use any of the enhanced ecommerce specific functionality.
ga('require', 'ec');
@qant
qant / modify_printify_response.php
Created April 26, 2023 07:01
modify printify response for wordpress http request http_response
<?php
/**
* @see Printify_Shipping_API::get_shipping_rates()
* @see \WP_Http::request()
*/
function modify_printify_response( $response, $parsed_args, $url ) {
// Check is it a request to Printify.
if( 0 !== strpos( $url, 'https://api-prod.printify.com' ) ) {
@qant
qant / modify_rest_request.php
Last active April 26, 2023 06:58
modify wordpress rest request
<?php
/**
* @see \WP_REST_Server::respond_to_request();
*
* @param \WP_REST_Response|\WP_HTTP_Response|\WP_Error|mixed $response Result to send to the client.
* Usually a WP_REST_Response or WP_Error.
* @param array $handler Route handler used for the request.
* @param \WP_REST_Request $request Request used to generate the response.
*/
@qant
qant / wc-rest-api-products-images.php
Created March 28, 2023 08:00 — forked from seb86/wc-rest-api-products-images.php
WooCommerce REST API (Products) - Get the images for a product or product variation and returns all image sizes.
<?php
if ( ! function_exists( 'wc_rest_get_product_images' ) ) {
add_filter( 'woocommerce_rest_prepare_product_object', 'wc_rest_get_product_images', 10, 2 );
/**
* Get the images for a product or product variation
* and returns all image sizes.
*
* @param WP_REST_Request $request Request object.
* @param WC_Product|WC_Product_Variation $product Product instance.
@qant
qant / remove_barks_from_audio_free.txt
Created January 15, 2023 10:06
How to remove barks from voice recordings using free software on windows?
There are a few ways to remove barks from voice recordings using free software on Windows, depending on the type of software you have available.
1. Audacity: Audacity is a free and open-source audio editor that can be used to remove barks from voice recordings. To do this, first select the part of the audio with the bark, then go to the Effects menu and choose Noise Reduction. Follow the instructions to reduce the bark noise.
2. Adobe Audition: Adobe Audition is a popular audio editing software available for free. To remove barks, open the audio file in the program and select the section with the bark. Then, apply the Adaptive Noise Reduction effect, adjust the settings and click Process to reduce the bark noise.
3. WavePad: WavePad is a free audio editing program for Windows that can be used to remove barks. Select the part of the audio with the bark, then go to the Effects menu and choose Noise Reduction. Adjust the settings and click OK to reduce the bark noise.
4. Vocal Remover: Vocal Remover is a f
@qant
qant / gist:9941414a808c487edd556aed99a2e98b
Created January 15, 2023 10:05
How to remove barks from voice recordings using adobe premiere pro?
1. In Adobe Premiere Pro, go to the Audio Effects tab in the Effects panel.
2. Select the Noise Reduction/Restoration category.
3. Drag the Adaptive Noise Reduction effect onto your voice recording clip.
4. Move the slider to adjust the amount of noise reduction applied to the clip.
5. Play back the clip to hear the difference.
@qant
qant / style.html
Created December 24, 2022 10:46
CSS online edit
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<style style='position: fixed;