Skip to content

Instantly share code, notes, and snippets.

View orion55's full-sized avatar

Orion55 orion55

  • 01:56 (UTC +05:00)
View GitHub Profile
@orion55
orion55 / cache.php
Last active November 4, 2018 11:59
<link rel='stylesheet' href='<?php bloginfo('template_url') ?>/css/main.css?v=<?php echo time(); ?> '
type='text/css' media='all'/>
<?php wp_head(); ?>
@orion55
orion55 / bullet.css
Last active February 24, 2018 17:15
Цвет буллета
ul.front-list li::before {
content: "•";
color: #63B724;
display: inline-block;
width: 1em;
margin-left: -1em
}
@orion55
orion55 / Horizontally centering an absolute element.css
Last active February 25, 2018 08:21
Horizontally centering an absolute element
#somelement {
position: absolute;
left: 50%;
transform: translateX(-50%)
}
@orion55
orion55 / Одноуровневое меню.js
Last active March 31, 2018 15:33
Одноуровневое меню
$(document).ready(function () {
var menu = $('#menu-topmenu');
var hasChildren = menu.find(".menu-item-has-children");
hasChildren.each(function () {
$(this).find('.sub-menu').hide();
var aHref = $(this).children('a');
aHref.html(aHref.html() + ' <i class="fas fa-caret-down"></i>');
});
@orion55
orion55 / Все блоки одинаковой высоты.css
Last active March 28, 2018 18:37
Все блоки одинаковой высоты
.product-main {
display: flex;
flex-direction: column;
height: 100%;
justify-content: center;
align-items: center;
}
.container{
display: flex;
@orion55
orion55 / debounce.js
Last active August 5, 2020 05:03
debounce
// Returns a function, that, as long as it continues to be invoked, will not
// be triggered. The function will be called after it stops being called for
// N milliseconds. If `immediate` is passed, trigger the function on the
// leading edge, instead of the trailing.
function debounce(func, wait, immediate) {
var timeout;
return function() {
var context = this, args = arguments;
var later = function() {
timeout = null;
@orion55
orion55 / number with commas as thousands separators
Last active April 2, 2018 17:53
number with commas as thousands separators
var n = 34523453.345
n.toLocaleString("ru")
"34 523 453.345"
@orion55
orion55 / theme_name_scripts.php
Last active August 5, 2020 05:02
theme_name_scripts
add_action( 'wp_enqueue_scripts', 'theme_name_scripts' );
function theme_name_scripts() {
wp_enqueue_style( 'info-style', get_template_directory_uri() . '/info-widget/info.css', array(), time(), 'all' );
wp_enqueue_script("jquery");
wp_enqueue_script( 'info-script', get_template_directory_uri() . '/info-widget/script.js', array( 'jquery' ), time(), true );
}
@orion55
orion55 / min-device-width.css
Last active June 9, 2021 09:02
Разрешения для планшетов и сотовых
@media only screen and (min-width: 768px) and (max-width: 1199px) {
}
@media only screen and (max-width: 767px) {
}
min-width: 320px;
@orion55
orion55 / jQuery(document).ready
Last active August 5, 2020 04:57
jQuery(document).ready
jQuery(document).ready(function ($) {
});