Skip to content

Instantly share code, notes, and snippets.

View gerharddt's full-sized avatar

Gerhard gerharddt

View GitHub Profile
@alekseykulikov
alekseykulikov / index.md
Last active October 12, 2024 17:02
Principles we use to write CSS for modern browsers

Recently CSS has got a lot of negativity. But I would like to defend it and show, that with good naming convention CSS works pretty well.

My 3 developers team has just developed React.js application with 7668 lines of CSS (and just 2 !important). During one year of development we had 0 issues with CSS. No refactoring typos, no style leaks, no performance problems, possibly, it is the most stable part of our application.

Here are main principles we use to write CSS for modern (IE11+) browsers:

@timersys
timersys / remove-woo-slug.php
Last active May 24, 2023 09:01
Remove product-category slug from Woocommerce
<?php
/*
Plugin Name: Remove product-category slug
Plugin URI: https://timersys.com/
Description: Check if url slug matches a woocommerce product category and use it instead
Version: 0.1
Author: Timersys
License: GPLv2 or later
*/
@levantoan
levantoan / [OLD]-remoce-product-category-parent.php
Last active November 19, 2022 05:50
Remove product-category and all parents slug product category in link Woocommerce
<? php
// Remove product cat base
add_filter('term_link', 'devvn_no_term_parents', 1000, 3);
function devvn_no_term_parents($url, $term, $taxonomy) {
if($taxonomy == 'product_cat'){
$term_nicename = $term->slug;
$url = trailingslashit(get_option( 'home' )) . user_trailingslashit( $term_nicename, 'category' );
}
return $url;
}