Skip to content

Instantly share code, notes, and snippets.

View webdevs-pro's full-sized avatar

Alex Ishchenko webdevs-pro

View GitHub Profile
@webdevs-pro
webdevs-pro / webview.js
Last active November 12, 2024 07:09
Ferdium Notion receipt webview.js
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : { default: obj };
}
const _path = _interopRequireDefault(require('path'));
module.exports = Ferdium => {
const getMessages = () => {
let direct = 0;
const badgeDiv = document.querySelector(
@webdevs-pro
webdevs-pro / keys.ahk
Created October 23, 2024 04:18
My AHK skript
#F1::
SetInputLang(0x0409)
Sleep, 100
SoundPlay, %A_WinDir%\Media\Speech On.wav
ToolTip, EN
SetTimer, RemoveToolTip, -1000
Return
#F2::
@webdevs-pro
webdevs-pro / config.json
Created October 23, 2024 04:10
Windhawk taskbar Styler Mod config
{"theme":"","controlStyles[0].target":"Taskbar.TaskListLabeledButtonPanel@RunningIndicatorStates > Rectangle#RunningIndicator","controlStyles[0].styles[0]":"Height=2","resourceVariables[0].variableKey":"","resourceVariables[0].value":"","controlStyles[0].styles[1]":"Margin=2,0,2,-4","controlStyles[1].target":"taskbar:TaskListLabeledButtonPanel@RunningIndicatorStates > muxc:ProgressBar#ProgressIndicator > Grid#LayoutRoot","controlStyles[1].styles[0]":"Height=2","controlStyles[2].target":"taskbar:TaskListLabeledButtonPanel@RunningIndicatorStates > muxc:ProgressBar#ProgressIndicator","controlStyles[2].styles[0]":"Margin=2,0,2,-4"}
@webdevs-pro
webdevs-pro / index.php
Created August 29, 2023 06:41
PHP Function to Reorder Array Elements Based on a Template Array and a Custom Comparison Key
<?php
$value = [
[
'attribute_type' => 'pa_merchant',
'pa_merchant' => [ 305 ],
],
[
'attribute_type' => 'pa_brand',
'pa_brand' => [ 692 ],
],
@webdevs-pro
webdevs-pro / index.php
Created January 21, 2023 21:52
WooCommerce remove outofstock products from related
add_filter( 'woocommerce_related_products', 'exclude_oos_related_products', 10, 3 );
function exclude_oos_related_products( $related_posts, $product_id, $args ){
$out_of_stock_product_ids = (array) wc_get_products( array(
'status' => 'publish',
'limit' => -1,
'stock_status' => 'outofstock',
'return' => 'ids',
) );
$exclude_ids = $out_of_stock_product_ids;
@webdevs-pro
webdevs-pro / YouTubeURLFormats.txt
Created May 15, 2022 19:34 — forked from rodrigoborgesdeoliveira/ActiveYouTubeURLFormats.txt
Example of the various YouTube url formats
http://www.youtube.com/watch?v=-wtIMTCHWuI
http://www.youtube.com/v/-wtIMTCHWuI?version=3&autohide=1
http://youtu.be/-wtIMTCHWuI
http://www.youtube.com/oembed?url=http%3A//www.youtube.com/watch?v%3D-wtIMTCHWuI&format=json
http://www.youtube.com/attribution_link?a=JdfC0C9V6ZI&u=%2Fwatch%3Fv%3DEhxJLojIE_o%26feature%3Dshare
<?php
$data = @json_decode( get_post_meta( 21361, '_elementor_data', true ), true );
if ( $data ) {
function stylepress_email_find( $data, $findkey ) {
if ( is_array( $data ) ) {
foreach ( $data as $d ) {
if ( $d && ! empty( $d['id'] ) && $d['id'] === $findkey ) {
return $d;
}
if ( $d && ! empty( $d['elements'] ) && is_array( $d['elements'] ) ) {
<?php
class AIGetElementSettings {
public function __construct( $postid, $widget_id, $widget_type ) {
$this->postid = $postid;
$this->widget_id = $widget_id;
$this->widget_type = $widget_type;
$this->widget = null;
$this->parse();
}
@webdevs-pro
webdevs-pro / index.js
Created January 20, 2022 12:45
Elementor controls events
elementor.channels.editor.on('section:activated', function(sectionName, editor) {
var editedElement = editor.getOption('editedElementView');
if ('frymo-contact-form' !== editedElement.model.get('widgetType')) {
return;
}
console.log('sectionName', sectionName);
console.log('editor', editor);
var isSideBSection = -1 !== ['section_form', 'fields_styles'].indexOf(sectionName);
editedElement.$el.toggleClass('test', isSideBSection);
});
@webdevs-pro
webdevs-pro / index.html
Created December 13, 2021 15:50
Elementor custom animated progress bar with waypoint
<div class="pref-progress" data-percent="50">
<div class="pref-bar"><div class="pref-perc">0%</div></div>
</div>
<br>
<div class="pref-progress" data-percent="72">
<div class="pref-bar"><div class="pref-perc">0%</div></div>
</div>
<br>
<div class="pref-progress" data-percent="99">
<div class="pref-bar"><div class="pref-perc">0%</div></div>