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 | |
function getUserTrafficSource() { | |
$source = 'unknown'; // Default to unknown | |
$details = []; // To store additional details | |
// 1. Check for UTM parameters (most reliable for ads) | |
if (isset($_GET['utm_medium'])) { | |
if ($_GET['utm_medium'] === 'cpc' || $_GET['utm_medium'] === 'paid') { | |
$source = 'ad'; | |
$details['ad_platform_guess'] = isset($_GET['utm_source']) ? $_GET['utm_source'] : 'unknown_platform'; |
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/env python | |
# | |
# Convert a maildir to a mbox file. ( python3 ) | |
# | |
# Inspired by : Felipe Pena <[email protected]> | |
# | |
import mailbox | |
import sys |
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
-- 1. Update siteurl and home | |
UPDATE wp_options | |
SET option_value = REPLACE(option_value, 'http://site.local', 'https://site.com') | |
WHERE option_name IN ('siteurl', 'home'); | |
-- 2. Update post content (links, images, etc.) | |
UPDATE wp_posts | |
SET post_content = REPLACE(post_content, 'http://site.local', 'https://site.com'); | |
-- 3. Update GUIDs (optional - normally shouldn't be changed unless migrating) |
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
# 🔐 Connect to Remote Server via SSH | |
# Establishes a secure SSH connection to a remote server using a specific port (e.g., 6543). Useful for accessing and managing remote systems. | |
ssh -p port [email protected] | |
ssh -p 6543 [email protected] | |
# 📦 Compress Website Directories into .tar.gz Archives | |
# Creates compressed .tar.gz archives of the uploads, themes, and plugins directories. Ideal for backup or transfer. | |
tar -czf uploads.tar.gz ./uploads |
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
<IfModule mod_expires.c> | |
ExpiresActive On | |
# Images (e.g., JPEG, PNG, GIF, SVG) | |
ExpiresByType image/jpeg "access plus 1 year" | |
ExpiresByType image/png "access plus 1 year" | |
ExpiresByType image/gif "access plus 1 year" | |
ExpiresByType image/svg+xml "access plus 1 year" | |
ExpiresByType image/webp "access plus 1 year" | |
ExpiresByType image/x-icon "access plus 1 year" #favicon |
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
# chat About you Code ( Ctrl + Alt + I ) | |
# Make changes using natural language ( Ctrl + Shift + Alt + I ) |
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 | |
// This can be found in the Symfony\Component\HttpFoundation\Response class | |
const HTTP_CONTINUE = 100; | |
const HTTP_SWITCHING_PROTOCOLS = 101; | |
const HTTP_PROCESSING = 102; // RFC2518 | |
const HTTP_OK = 200; | |
const HTTP_CREATED = 201; | |
const HTTP_ACCEPTED = 202; |
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
# create api key | |
https://www.bing.com/indexnow/getstarted | |
# upload indexnow-api-key-file.txt to your website with content 'indexnow-api-key' | |
# indexnow.org | |
https://api.indexnow.org/indexnow?url=https://site.net/page-url/&key=indexnow-api-key | |
# bing.com | |
https://www.bing.com/indexnow?url=https://site.net/page-url/&key=indexnow-api-key |
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
editor.windowManager.open({ | |
title: 'Options', | |
body: [ | |
{ | |
type : 'listbox', | |
name : 'imgalign', | |
label : 'Image direction', | |
values : [ | |
{ text: 'Image right', value: 'right' }, |
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
/* | |
##Device = Desktops | |
##Screen = 1281px to higher resolution desktops | |
*/ | |
@media (min-width: 1281px) { | |
/* CSS */ | |
} |
NewerOlder