Skip to content

Instantly share code, notes, and snippets.

View Lovor01's full-sized avatar
💭
I may be slow to respond.

Lovro Hrust Lovor01

💭
I may be slow to respond.
  • makeITeasy
  • Zagreb
View GitHub Profile
@Lovor01
Lovor01 / Suppress deprecated in WP.md
Last active January 11, 2023 22:34
Suppress deprecated in WP

Suppress deprecated errors

<?php

error_reporting(E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED);
@Lovor01
Lovor01 / row-gap.md
Created September 11, 2022 12:32
Grid gap bug

Bug

Gap in % provokes a bug that grid vertical size is miscalculated, cells are adequate size, but total size is less

@Lovor01
Lovor01 / cookie functions.md
Last active September 14, 2022 23:03
Get/set cookie
@Lovor01
Lovor01 / mysql_mariadb command line.md
Last active September 21, 2022 21:58
Database command line

Database login

mysql --user=user --password=password database

Set database

USE database

@Lovor01
Lovor01 / Grid.md
Last active December 19, 2022 22:07
Css grid peculiarities
@Lovor01
Lovor01 / autoprefixer.md
Created October 6, 2022 21:21
Prevent autoprefixer from fixing prefixes for other browsers

Add this line before css

/* autoprefixer: off */

@Lovor01
Lovor01 / catch_variation.md
Created October 18, 2022 22:01
Catch block variation and enqueue assets

How to catch block variation and optimize assets

use pre_render_block hook

/**
 * catch block variation 'apply-to-program' and enqueue assets!
 */
add_filter( 'pre_render_block', function($pre_render, $parsed_block, $parent_block ) {
	if ($parsed_block['blockName'] === 'makeiteasy/call-to-action' &amp;&amp; $parsed_block['attrs']['blockType'] === 3)
@Lovor01
Lovor01 / Solution.md
Last active January 11, 2023 22:35
Incompatibility - node 18

Incompatibility - node 18 and legacy webpack server

In case of error message

Set NODE_OPTIONS environment variable

"start": "set NODE_OPTIONS=--openssl-legacy-provider && wp-scripts start --webpack-copy-php"

npm composer
install update
@Lovor01
Lovor01 / clean-disk-space.md
Created January 16, 2023 01:14
Remove node_modules