location ~* ^(/.+)\.(jpg|jpeg|jpe|png|gif)$ {
add_header Vary Accept;
if ($http_accept ~* "webp"){
set $imwebp A;
}
if (-f $request_filename.webp) {
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
SELECT Id, Phone, | |
CASE( | |
/* Check if phone number contains a country code */ | |
IF( | |
REGEX(Phone, '^[+](.*)$'), | |
/* If phone number already contains country code, format it */ | |
REGEX( | |
SUBSTITUTE(Phone, ' ', ''), | |
'[\\+]', '00' | |
), |
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
// core version | |
import { gsap } from "gsap"; | |
// Accordion for Task | |
// Helper function to get elements by class name and return the first match | |
function getElementByClassName(className) { | |
return document.querySelector('.' + className); | |
} |
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
// core version | |
import { gsap } from "gsap"; | |
import { Flip } from "gsap/flip"; | |
gsap.registerPlugin(Flip); | |
// Accordion for Task | |
const groups = gsap.utils.toArray(".accordion-group"); | |
groups.forEach(el => { | |
el.addEventListener("click", () => toggleMenu(el)); |
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 | |
/** | |
* Delete pages | |
* @link https://developer.wordpress.org/reference/functions/wp_delete_post/ | |
*/ | |
function apsolut_delete_multiple_pages_from_plugin() { | |
// Set an array of page IDs to delete | |
$page_ids = array(1, 2, 3); // Hello World, Homepage, Privacy Policy |
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
wsl -u root -e bash -c "apt-get upgrade -y >/dev/null" | |
wsl bash -c 'sudo usermod -aG docker $USER' | |
wsl bash -c 'echo CAROOT=$CAROOT' | |
wsl -u root mkcert -install | |
wsl -u root service docker start | |
if (-not(wsl -e docker ps)) { | |
throw "docker does not seem to be working inside the WSL2 distro yet. " | |
} | |
# If docker desktop was previously set up, the .docker can break normal use of docker client. |
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
location ~* ^(/.+)\.(jpg|jpeg|jpe|png|gif)$ { | |
add_header Vary Accept; | |
if ($http_accept ~* "webp"){ | |
set $imwebp A; | |
} | |
if (-f $request_filename.webp) { | |
set $imwebp "${imwebp}B"; | |
} | |
if ($imwebp = AB) { |
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 | |
// Sites: | |
$production_name='INSTALL_PRD'; | |
$staging_name='INSTALL_STG'; | |
$development_name='INSTALL_DEV'; | |
// Check if PWP_NAME is set | |
if (defined('PWP_NAME')) { |
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
# all files | |
node_modules/ | |
hubspot.config.yaml | |
.DS_Store | |
# editors | |
.vscode | |
.idea | |
.env | |
.env.* | |
*.psd |
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 | |
/** | |
* | |
* @URL https://developer.wordpress.org/reference/functions/wp_get_environment_type/ | |
* define( 'WP_ENVIRONMENT_TYPE', 'local' ); | |
* for each environment put it to wp-config | |
* | |
/ |