Skip to content

Instantly share code, notes, and snippets.

<?php
add_filter( 'locale','redefine_locale', 10 );
function redefine_locale( $locale ) {
$lang = ( isset( $_GET['lang'] ) ) ? esc_html( $_GET['lang'] ) : '';
switch ( $lang ) {
case 'en':
$locale = 'en_US';
break;
@Zalki-Lab
Zalki-Lab / gist:1c3e6681ba2792411d00a4b6d650073d
Created October 30, 2019 21:28
Install Composer on OpenServer
cd modules/php/PHP-7.0-x64/
php -r "readfile('https://getcomposer.org/installer');" | php
php composer.phar -V
@Zalki-Lab
Zalki-Lab / hide-arrows-input-number.css
Created September 24, 2018 12:39
hide-arrows-input-number
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
input[type="number"] {
-moz-appearance: textfield;
}
@Zalki-Lab
Zalki-Lab / disable-arrows-and-keys-number-inputs.js
Created September 24, 2018 12:31
disable-arrows-and-keys-number-inputs
(function ($) {
$(document).ready(function () {
$(document).on('focus', 'input[type=number]', function (e) {
$(this).on('wheel', function (e) {
return false;
});
});
.ui-datepicker {
background-color: #fff;
border: 1px solid #66afe9;
border-radius: 4px;
box-shadow: 0 0 8px rgba(102,175,233,.6);
display: none;
margin-top: 4px;
padding: 10px;
width: 240px;
}
<?php
$iPod = stripos($_SERVER['HTTP_USER_AGENT'],"iPod");
$iPhone = stripos($_SERVER['HTTP_USER_AGENT'],"iPhone");
$iPad = stripos($_SERVER['HTTP_USER_AGENT'],"iPad");
$Android = stripos($_SERVER['HTTP_USER_AGENT'],"Android");
if( $iPod || $iPhone || $iPad ){
echo "ios";
}else if($Android){
<?php
add_filter( 'wp_calculate_image_srcset', '__return_false' );
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Перезагрузка страницы</title>
<meta http-equiv="refresh" content="5" />
</head>
<body>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Перезагрузка страницы</title>
</head>
<body>
<script type="text/javascript">
setTimeout(function(){
location.reload();
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Перезагрузка страницы</title>
</head>
<body>
<script type="text/javascript">
function refreshPage(){
window.location = window.location.href;