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
$formLayout = preg_replace('/style=\\"[^\\"]*\\"/', '', $formLayout); |
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
services: | |
joomla: | |
image: joomla:latest | |
restart: always | |
links: | |
- db:mysql | |
depends_on: | |
- db | |
healthcheck: | |
test: ['CMD-SHELL', 'mysqladmin ping -h localhost -u root -psecret'] |
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 | |
session_start(); | |
// Zeitraum in Sekunden, in dem die Anzahl der Versuche begrenzt wird | |
$limitPeriod = 3600; // 1 Stunde | |
// Maximale Anzahl erlaubter Versuche pro IP-Adresse und Fingerprint innerhalb des Zeitraums | |
$maxAttempts = 3; | |
// Generiere einen eindeutigen Fingerprint basierend auf IP-Adresse, User-Agent und Cookies |
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 | |
session_start(); | |
// Zeitraum in Sekunden, in dem die Anzahl der Versuche begrenzt wird | |
$limitPeriod = 3600; // 1 Stunde | |
// Maximale Anzahl erlaubter Versuche pro IP-Adresse innerhalb des Zeitraums | |
$maxAttempts = 3; | |
// Eindeutiger Schlüssel für die IP-Adresse in der Session |
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 | |
// Source: http://goo.gl/qyLFbg | |
$html = '<img border="0" src="/images/image.jpg" alt="Image" width="100" height="100" />'; | |
preg_match( '@src="([^"]+)"@' , $html, $match ); | |
$src = array_pop($match); | |
// will return /images/image.jpg |
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
// easing functions http://goo.gl/5HLl8 | |
Math.easeInOutQuad = function (t, b, c, d) { | |
t /= d/2; | |
if (t < 1) { | |
return c/2*t*t + b | |
} | |
t--; | |
return -c/2 * (t*(t-2) - 1) + b; | |
}; |
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 | |
class JoomlaHelper{ | |
/** | |
* Obtiene la versión de Joomla (3,4, ...) | |
* | |
* @return string Versión mayor de Joomla | |
*/ |
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
{ | |
"Arrow Function": { | |
"prefix": "arrow", | |
"body": ["const $1 = () => {", "$0", "}"], | |
"description": "Arrow Function" | |
}, | |
"Fetch": { | |
"prefix": "fetch", | |
"body": [ | |
"try {", |
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
add_filter( 'woocommerce_product_data_store_cpt_get_products_query', 'handle_price_range_query_var', 10, 2 ); | |
function handle_price_range_query_var( $query, $query_vars ) { | |
if ( ! empty( $query_vars['price_range'] ) ) { | |
$price_range = explode( '|', esc_attr($query_vars['price_range']) ); | |
if ( is_array($price_range) && count($price_range) == 2 ) { | |
$query['meta_query']['relation'] = 'AND'; | |
$query['meta_query'][] = array( | |
'key' => '_price', |
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 get_filtered_price() { | |
global $wpdb; | |
$args = wc()->query->get_main_query(); | |
$tax_query = isset( $args->tax_query->queries ) ? $args->tax_query->queries : array(); | |
$meta_query = isset( $args->query_vars['meta_query'] ) ? $args->query_vars['meta_query'] : array(); | |
foreach ( $meta_query + $tax_query as $key => $query ) { | |
if ( ! empty( $query['price_filter'] ) || ! empty( $query['rating_filter'] ) ) { |
NewerOlder