Skip to content

Instantly share code, notes, and snippets.

View AnatoliyAkhmatov's full-sized avatar
♣️

Anatoliy AnatoliyAkhmatov

♣️
View GitHub Profile
$('#input_name').keypress(function(e) {
if (e.keyCode == 32) return false;
if (this.value.length == 1) {
this.value = this.value.toUpperCase()
}
});
$('.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
},
})
window.onDo = (f) => {
let loaded = false
let d = () => {
if (!loaded) {
f()
loaded = true
window.removeEventListener('scroll', d, {passive: true})
window.removeEventListener('touchstart', d)
<?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');
get_term_by( 'slug', 'zelenyj', esc_attr( str_replace( 'attribute_', '', 'attribute_pa_color' ) ) ))
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();
$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;
}
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']
.t-btn
position: relative
overflow: hidden
padding: 20px
background: #fff
display: inline-block
.bg
position: absolute
background: red
<iframe src="https://yandex.ru/sprav/widget/rating-badge/xxxx" width="150" height="50" frameborder="0" theme='dark'></iframe>
iframe
filter: invert(90%)