Skip to content

Instantly share code, notes, and snippets.

View Lovor01's full-sized avatar

Lovro Hrust Lovor01

  • makeITeasy
  • Zagreb
View GitHub Profile
@Lovor01
Lovor01 / .htaccess
Last active April 8, 2020 18:06 — forked from Darep/.htaccess
PHP CSS&JS auto-versioning function.
# CSS/JS auto-versioning
RewriteEngine On
RewriteRule ^(.*)\.[\d]{10}\.(css|js)$ $1.$2 [L]
@Lovor01
Lovor01 / Embed google fonts in WordPress
Last active January 8, 2021 09:21
A list of functions.php essential things
// google fonts
wp_enqueue_style( 'google_fonts', 'https://fonts.googleapis.com/css2?family=Encode+Sans:wght@400;600&family=Spectral&display=swap', array(), null );
@Lovor01
Lovor01 / OpenSSL prepare self signed certificate.md
Last active April 30, 2024 14:45
OpenSSL prepare self signed certificate

Solution 1

..\..\bin\openssl req -x509 -sha256 -nodes -config ..\openssl.cnf -days 1095 -newkey rsa:2048 -keyout altius.duckdns.org.key -out altius.duckdns.org.crt -set_serial [set number here]

ili

$env:OPENSSL_CONF = 'C:\Wamp.NET\servers\2-apache-2.4.57\conf\openssl.cnf'
..\..\bin\openssl req -x509 -sha256 -nodes -days 1095 -newkey rsa:2048 -keyout altius.duckdns.org.key -out altius.duckdns.org.crt -set_serial [set number here]
@Lovor01
Lovor01 / create pot.md
Last active October 24, 2021 00:09
Create pot files using wp-cli

Create pot

wp i18n make-pot . languages/gmk.pot
wp search-replace 'http://example.test' 'http://example.com' --skip-columns=guid --dry-run
--dry-run //for dry run
--export=database.sql // for export database
@Lovor01
Lovor01 / core-blocks.md
Last active October 24, 2021 00:06 — forked from DavidPeralvarez/core-blocks.txt
Gutenberg core blocks list

Apache create new user

-c switch creates file (and deletes other users)

#Apache create basic auth passw file
.\htpasswd -bB -C13 ..\conf\auth.users username password

#verify user
.\htpasswd -bv ..\conf\auth.users username password
magick mogrify -format jpg -quality 95 -path "C:\Users\Lovro\Documents\Posao\Link2\Piranesi\Optimizirane slike" *.tif
wp media regenerate
UPDATE `topomati_cp1`.`cp_options` SET `option_value` =
(SELECT `option_value` FROM `topomati_cp_hr`.`cp_options` WHERE `option_name` = 'wpb_js_templates')
WHERE `option_name` = 'wpb_js_templates';