This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// set language attribute of the main <html> tag hardcoded | |
function new_language_attributes($lang){ | |
return "lang=\"it\""; | |
} | |
add_filter('language_attributes', 'new_language_attributes'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// set language attribute of the main <html> tag based on category value | |
function new_language_attributes($lang){ | |
if(is_single()) { | |
$ar = get_the_category(); | |
foreach($ar as $c) { | |
if($c->slug=='in-italiano') { | |
return "lang=\"it\""; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// clear cart before adding new one | |
add_filter( 'woocommerce_add_to_cart_validation', 'remove_cart_item_before_add_to_cart', 20, 3 ); | |
function remove_cart_item_before_add_to_cart( $passed, $product_id, $quantity ) { | |
if( ! WC()->cart->is_empty() ) | |
WC()->cart->empty_cart(); | |
return $passed; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// redirect Add To Cart > Checkout | |
add_filter ('woocommerce_add_to_cart_redirect', function( $url, $adding_to_cart ) { | |
return wc_get_checkout_url(); | |
}, 10, 2 ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'woocommerce_checkout_after_terms_and_conditions', 'custom_woocommerce_empty_cart_button' ); | |
function custom_woocommerce_empty_cart_button() { | |
echo '<a href="/?empty_cart=yes" class="rq-btn rq-btn-transparent" title="' . esc_attr( 'Cancel Order', 'woocommerce' ) . '">' . esc_html( 'Cancel Order', 'woocommerce' ) . '</a>'; | |
// echo '<a href="' . esc_url( '/cart' . add_query_arg( 'empty-cart', 'yes' ) ) . '" class="rq-btn rq-btn-transparent" title="' . esc_attr( 'Cancel Order', 'woocommerce' ) . '">' . esc_html( 'Cancel Order', 'woocommerce' ) . '</a>'; | |
} | |
add_action( 'wp_loaded', 'custom_woocommerce_empty_cart_action', 20 ); | |
function custom_woocommerce_empty_cart_action() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'woocommerce_return_to_shop_redirect', 'mysite_change_return_shop_url' ); | |
function mysite_change_return_shop_url() { | |
return home_url(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" /> | |
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" /> | |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/tw-elements/dist/css/index.min.css" /> | |
<script src="https://cdn.tailwindcss.com"></script> | |
<script> | |
tailwind.config = { | |
theme: { | |
extend: { | |
fontFamily: { | |
sans: ['Inter', 'sans-serif'], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
"""Convert of vtt to srt format""" | |
import os | |
import re | |
import sys | |
from string import Template | |
from stat import S_ISDIR, ST_MODE, S_ISREG |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { string, number, object } from "yup"; | |
// import { passwordResetRequestVerifyCode } from "./session.server"; | |
const uuid = string().uuid("Gabim në identifikimin e linkut!"); | |
const vatid = string().matches( | |
/^([a-z][0-9]{8,10}[a-z])$/gi, | |
"Numri NIPT është gabim! (Shembull X12345678X)" | |
); | |
const password = string().min(6).max(128); | |
const loginType = string().oneOf( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Install WireGuard via whatever package manager you use. For me, I use apt. | |
# Ubuntu server install | |
$ sudo apt-get install wireguard | |
# MacOS client using brew | |
$ brew install wireguard-tools | |
Generate key your key pairs. The key pairs are just that, key pairs. They can be | |
generated on any device, as long as you keep the private key on the source and |