Skip to content

Instantly share code, notes, and snippets.

View PeterRamotowski's full-sized avatar

Peter Ramotowski PeterRamotowski

  • Poland, Warsaw, Wroclaw
View GitHub Profile
@PeterRamotowski
PeterRamotowski / nginx-ha-reverse-proxy.md
Created November 29, 2022 19:34
Nginx Reverse Proxy for Home Assistant

Nginx configuration to create a reverse proxy for Home Assistant

<host_name> - public domain under which Home Assistant will be available

<internal_ip> - IP address of local Home Assistant machine available from ZeroTier internal network

server {
	listen 80 default_server;
	listen [::]:80 default_server;
@PeterRamotowski
PeterRamotowski / Drupal 9 remove querystring from CSS & JS resources.md
Created November 15, 2020 14:41
Drupal 9 remove querystring from CSS & JS resources

Drupal 9 - remove querystring from CSS & JS resources

Insert this code to your THEME_NAME.theme file:

use Drupal\Core\Asset\AttachedAssetsInterface;

function THEME_NAME_css_alter(&$css, AttachedAssetsInterface $assets){
 foreach ($css as &amp;$file) {
@PeterRamotowski
PeterRamotowski / Wordpress-SQL-queries-to-update-the-site-address.md
Last active November 10, 2020 15:44
Wordpress SQL queries to update the site address (URL)

Wordpress SQL queries to replace all occurences of the old site address (URL) with the new one

Before use:

Both URL values shouldn't have a slash / at the end.

@PeterRamotowski
PeterRamotowski / Woocommerce-Javascript-events.md
Last active November 2, 2020 16:36
Woocommerce Javascript events

Woocommerce Javascript events

Woocommerce Add to cart JS events

$( document.body ).trigger( 'adding_to_cart', [ $thisbutton, data ] );
$( document.body ).trigger( 'added_to_cart', [ response.fragments, response.cart_hash, $thisbutton ] );
$( document.body ).trigger( 'removed_from_cart', [ response.fragments, response.cart_hash, $thisbutton ] );
$( document.body ).trigger( 'wc_cart_button_updated', [ $button ] );
$( document.body ).trigger( 'cart_page_refreshed' );