Skip to content

Instantly share code, notes, and snippets.

View ulziibat-n's full-sized avatar
💭
Everyday Hard Working ...

Ulziibat Nansaltsog ulziibat-n

💭
Everyday Hard Working ...
  • Mongolia
View GitHub Profile
@textarcana
textarcana / js_code_sniffs.md
Created August 17, 2012 03:37
Use PHP CodeSniffer for static analysis of JavaScript
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php
*/
$args = array(
@paulirish
paulirish / what-forces-layout.md
Last active May 6, 2024 07:54
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@parmentf
parmentf / GitCommitEmoji.md
Last active May 6, 2024 18:30
Git Commit message Emoji
@rvl
rvl / git-pushing-multiple.rst
Created February 9, 2016 11:41
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.

Pushing to Multiple Git Repos

If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.

Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.

If in doubt about what git is doing when you run these commands, just

@aristath
aristath / aricolor.md
Last active December 18, 2020 10:48
ariColor PHP Library for WordPress plugins and themes

ariColor is a PHP library that will hopefully help WordPress theme developers do their job easier and more effectively.

It does not provide you with methods like lighten(), darken() etc. Instead, what it does is give you the ability to create these yourself with extreme ease by giving you all the properties of a color at hand, and allowing you to manipulate them however you see fit.

Example:

First, let's create our color object:

$color = ariColor::newColor( '#049CBE', 'hex' );
@nicomollet
nicomollet / yoastseo-remove-breadcrumb-link.php
Last active June 1, 2023 01:11
Yoast SEO remove breadcrumb link
@nicomollet
nicomollet / yoastseo-add-breadcrumb-link.php
Last active June 9, 2023 12:51
Yoast SEO add first link in breadcrumb
@nicomollet
nicomollet / elementor-category-posts-per-page.php
Last active September 10, 2019 14:16
Elementor: Force posts per page number for posts widget on Category Pages
<?php
/**
* Elementor: Force posts per page number for posts widget on Category Pages
*
* @param $query
*/
function elementor_category_posts_per_page( $query ) {
$category_id_or_slug = 'myslug';
@nicomollet
nicomollet / elementorcssinhead.php
Last active December 6, 2022 09:21
Load Elementor styles on all pages in the head to avoid CSS files being loaded in the footer
<?php
/**
* Load Elementor styles on all pages in the head to avoid CSS files being loaded in the footer
*/
function elementor_css_in_head(){
if(class_exists('\Elementor\Plugin')){
$elementor = \Elementor\Plugin::instance();
$elementor->frontend->enqueue_styles();
}
if(class_exists('\ElementorPro\Plugin')){