This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo apt-get install -y devilspie | |
mkdir -p ~/.devilspie | |
echo ' | |
(if (contains (window_class) "Code") | |
(begin | |
(spawn_async (str "xprop -id " (window_xid) " -f _KDE_NET_WM_BLUR_BEHIND_REGION 32c -set _KDE_NET_WM_BLUR_BEHIND_REGION 0 ")) | |
(spawn_async (str "xprop -id " (window_xid) " -f _NET_WM_WINDOW_OPACITY 32c -set _NET_WM_WINDOW_OPACITY 0xD8000000")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"atomKeymap.promptV3Features": true, | |
"editor.multiCursorModifier": "ctrlCmd", | |
"editor.formatOnPaste": true, | |
"editor.fontFamily": "'Victor Mono', monospace", | |
"editor.fontLigatures": true, | |
// "editor.tokenColorCustomizations": { | |
// "textMateRules": [{ | |
// "scope": [ | |
// "storage.modifier", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($) { | |
/* ======== customSlider ======== */ | |
wp.hooks.addAction('facetwp/refresh/customSlider', function($this, facet_name) { | |
FWP.facets[facet_name] = []; | |
// settings have already been loaded | |
if ('undefined' !== typeof FWP.used_facets[facet_name]) { | |
if ('undefined' !== typeof $this.find('.facetwp-customSlider')[0].noUiSlider) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Verify captcha | |
$post_data = http_build_query( | |
array( | |
'secret' => CAPTCHA_SECRET, | |
'response' => $_POST['g-recaptcha-response'], | |
'remoteip' => $_SERVER['REMOTE_ADDR'] | |
) | |
); | |
$opts = array('http' => |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'woocommerce_bookings_in_date_range_query', 'wswp_filter_check_in_cart', 100, 1); | |
function wswp_filter_check_in_cart( $booking_ids ) { | |
foreach( $booking_ids as $key => $booking_id ) { | |
$booking = get_wc_booking( $booking_id ); | |
if ( $booking->has_status( 'in-cart' ) ) { | |
unset( $booking_ids[$key] ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function wp_editor_helper( $field ) { | |
$key = $field['name']; | |
$editor = array( | |
'textarea_name' => isset( $field['name'] ) ? $field['name'] : $key, | |
'media_buttons' => false, | |
'textarea_rows' => 8, | |
'quicktags' => false, | |
'tinymce' => array( | |
'plugins' => 'lists,paste,tabfocus,wplink,wordpress', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'rest_api_init', 'rest_api_filter_add_filters' ); | |
/** | |
* Add the necessary filter to each post type | |
**/ | |
function rest_api_filter_add_filters() { | |
foreach ( get_post_types( array( 'show_in_rest' => true ), 'objects' ) as $post_type ) { | |
add_filter( 'rest_' . $post_type->name . '_query', 'rest_api_filter_add_filter_param', 10, 2 ); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function call($url,$data=array()) { | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, $url); | |
curl_setopt($ch, CURLOPT_HEADER, 0); | |
// set custom headers | |
$headers = array('Accept: application/json'); | |
$headers[] = "X-Forwarded-For: {$_SERVER['REMOTE_ADDR']}"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Test Library on console | |
*/ | |
let cdn = "https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.4/lodash.min.js"; | |
let script = document.createElement('script'); | |
script .src = cdn; | |
document.getElementsByTagName('head')[0].appendChild(script); | |
// Now Test the library methods |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function advanced_asyc_scripts($url) { | |
if ( strpos( $url, '#asyncload') === false ) { | |
return $url; | |
} else if ( is_admin() ) { | |
return str_replace( '#asyncload', '', $url ); | |
} else { | |
return str_replace( '#asyncload', '', $url )."' async='async' defer='defer"; | |
} | |
} |
NewerOlder