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
@parmentf
parmentf / GitCommitEmoji.md
Last active May 6, 2024 18:30
Git Commit message Emoji
@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
@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

@josanua
josanua / theme-helper.php
Last active March 15, 2024 08:27
Theme Dev Helper
<?php
// General info
https://codex.wordpress.org/Theme_Development
// Core info
https://wp-learner.com/wotdpress-development/wordpress-core-files-and-functions/
// Theme Handbook
https://developer.wordpress.org/themes/
<?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(
@nicomollet
nicomollet / polylang-langswitcher-shortcode.php
Last active January 17, 2024 11:25
Polylang shortcode for lang switcher
<?php
/**
* Polylang Shortcode - https://wordpress.org/plugins/polylang/
* Add this code in your functions.php
* Put shortcode [polylang_langswitcher] to post/page for display flags
*
* @return string
*/
function custom_polylang_langswitcher() {
$output = '';
@MatthieuScarset
MatthieuScarset / .lando.yml
Created December 13, 2020 20:23
Lando (+3.0) with XDebug (WordPress recipe)
name: wordpress
recipe: wordpress
services:
appserver:
webroot: .
xdebug: debug
config:
php: .vscode/php.ini
tooling:
install:wordpress:
@PJoy
PJoy / guide.md
Last active June 17, 2023 04:50
SAGE BARBA

Using barba.js with Sage starter theme

Barba.js is a library using pushState and AJAX allowing websites to load pages asynchronously while still maintaining browser states and history.

Combining it with some JavaScript animations libraries can help craft some memorable browsing experiences.

alt text source

In this guide, we will try to find an optimal way to integrate Barba with our beloved Sage theme !

@nicomollet
nicomollet / wpseo-schema-webpage.php
Last active June 9, 2023 12:51
Yoast Schema: Remove datePublished on WebPage
<?php
/**
* Yoast Schema: Remove datePublished on WebPage
*
* @param array $schema
*
* @return mixed
*/
function custom_wpseo_schema_webpage( $schema ) {
@nicomollet
nicomollet / yoastseo-add-breadcrumb-link.php
Last active June 9, 2023 12:51
Yoast SEO add first link in breadcrumb