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
param() | |
function Validate-Input { | |
param ( | |
[string]$domain, | |
[string]$env | |
) | |
if ([string]::IsNullOrEmpty($domain)) { | |
Write-Host "Domain name cannot be empty. Please enter a valid domain name." -ForegroundColor Red |
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
<!-- HTML --> | |
<div class="snowflakes" aria-hidden="true"></div> | |
<!-- JavaScript --> | |
<script> | |
const snowflakesContainer = document.querySelector('.snowflakes'); | |
// Number of snowflakes you want to add | |
const numberOfSnowflakes = 100; |
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 Kosovo as a checkout country | |
add_filter('woocommerce_countries', 'snippetpress_add_kosovo'); | |
function snippetpress_add_kosovo($countries) { | |
// Add Kosovo to the list of countries | |
$countries['XK'] = __('Kosovo', 'woocommerce'); | |
return $countries; | |
} |
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 | |
# Loop through each WordPress installation directory under /home/*/public_html/ | |
for dir in /home/*/public_html/; do | |
# Check if the directory contains a wp-config.php file | |
if [ -f "${dir}wp-config.php" ]; then | |
echo -e "Processing ${dir}" | |
# Get the database credentials from wp-config.php | |
DB_NAME=$(grep "define( 'DB_NAME'" ${dir}wp-config.php | cut -d "'" -f 4) | |
DB_USER=$(grep "define( 'DB_USER'" ${dir}wp-config.php | cut -d "'" -f 4) |
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
if ( is_plugin_active( 'woocommerce/woocommerce.php' ) ) { | |
// WooCommerce plugin is active class is loaded | |
function replace_add_to_cart_button() { | |
// Output the "Request Quote" button | |
echo '<a href="/contatti/" class="request-quote-button single_add_to_cart_button button alt wp-element-button">Richiedi un preventivo</a>'; | |
return; | |
} | |
if (! class_exists( 'WC_Geolocation' ) ) { |
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
/** | |
* Kontrollon aksesin per pruktet | |
*/ | |
function sajdoko_to_login_if_not_customer() { | |
global $post; | |
$user_id = get_current_user_id(); | |
$current_user = wp_get_current_user(); |
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 | |
# $1 group (premium||free) | |
# $2 plugin slug (all||single-name) | |
if [ "$1" == "premium" ] ; then | |
if [ "$2" == "all" ] || [ "$2" == "js_composer" ] ; then | |
if curl -o js_composer.zip https://serverlocalweb.com/js_composer.zip ; then | |
shkarkova_js_composer="1" | |
fi | |
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 | |
function example_ajax_enqueue() { | |
// Enqueue javascript on the frontend. | |
wp_enqueue_script( | |
'example-ajax-script', | |
get_template_directory_uri() . '/js/simple-ajax-example.js', | |
array('jquery') | |
); |
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 | |
$host = ''; | |
$dbname = ''; | |
$user = ''; | |
$password = ''; | |
try { | |
$pdo = new PDO("mysql:host=" . $host . ";dbname=" . $dbname, $user, $password); | |
} catch (PDOException $e) { | |
die("ERROR: Could not connect. " . $e->getMessage()); |
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
const http = new easyHTTP(); | |
// Get Posts | |
http.get("https://jsonplaceholder.typicode.com/posts", function(err, posts) { | |
if (err) { | |
console.log(err); | |
} else { | |
console.log(posts); | |
} | |
}); |
NewerOlder