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
$('#input_name').keypress(function(e) { | |
if (e.keyCode == 32) return false; | |
if (this.value.length == 1) { | |
this.value = this.value.toUpperCase() | |
} | |
}); |
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
$('.index-gallery .link-y').magnificPopup({ | |
type: 'iframe', | |
iframe: { | |
markup: '<div class="mfp-iframe-scaler">'+ | |
'<div class="mfp-close"></div>'+ | |
'<video class="mfp-iframe" frameborder="0" allowfullscreen autoplay></video>'+ | |
'</div>', // HTML markup of popup, `mfp-close` will be replaced by the close button | |
}, | |
}) |
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
window.onDo = (f) => { | |
let loaded = false | |
let d = () => { | |
if (!loaded) { | |
f() | |
loaded = true | |
window.removeEventListener('scroll', d, {passive: true}) | |
window.removeEventListener('touchstart', d) |
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 | |
require '../vendor/autoload.php'; | |
use PhpOffice\PhpSpreadsheet\Spreadsheet; | |
use PhpOffice\PhpSpreadsheet\Writer\Xlsx; | |
$cols = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']; | |
$spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load('../answers.xlsx'); |
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
get_term_by( 'slug', 'zelenyj', esc_attr( str_replace( 'attribute_', '', 'attribute_pa_color' ) ) )) |
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
global $woocommerce; | |
$order = wc_get_order( $order_id ); | |
if ( $order ) { | |
$order->get_id(); | |
$order->get_order_key(); | |
$order->get_formatted_order_total(); | |
$order->get_cart_tax(); | |
$order->get_currency(); |
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
$url = strtok($_SERVER['REQUEST_URI'], '?'); | |
$last_char = substr($url, -1); | |
if ($last_char == '/' && $url != '/') { | |
$url = substr($url, 0, strlen($url) - 1); | |
if (!empty($_GET)) { | |
$url .= '?' . http_build_query($_GET); | |
} | |
header('Location: ' . $url, 301); | |
exit; | |
} |
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
const queryString = window.location.search; | |
const urlParams = new URLSearchParams(queryString); | |
// https://example.com/path/to/page?color=purple&size=M&size=L | |
urlParams.get('color') // purple | |
urlParams.getAll('size') // ['M', 'L'] |
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
<iframe src="https://yandex.ru/sprav/widget/rating-badge/xxxx" width="150" height="50" frameborder="0" theme='dark'></iframe> | |
iframe | |
filter: invert(90%) |
NewerOlder