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
async function handler(event) { | |
const request = event.request; | |
const uri = request.uri; | |
// Determine if the URI has a query string. | |
const hasQuery = uri.indexOf('?') !== -1; | |
// Determine if the URI has a file extension. | |
// An extension is considered present if there's a dot, and the last dot | |
// appears after the last slash (indicating it's part of a filename, not a directory). |
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
DELIMITER // | |
-- Drop the procedure if it already exists | |
DROP PROCEDURE IF EXISTS convert_chars_to_utf8mb4 // | |
-- Create the procedure to convert character set of columns | |
CREATE PROCEDURE convert_chars_to_utf8mb4(IN db_name VARCHAR(255)) | |
BEGIN | |
-- Declare variables for cursor and loop control | |
DECLARE done INT DEFAULT FALSE; |
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 bash | |
# ------------------------------------------------------------------------------ | |
# Script Name: update-litespeed-cache.sh | |
# Description: This script updates the LiteSpeed Cache plugin for all WordPress | |
# installations on a DirectAdmin server. It checks for the WP-CLI | |
# tool and installs it if not found, then updates the specified plugin | |
# for each user's domains. | |
# | |
# Author: Kawin Viriyaprasopsook |
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 bash | |
# Ensure the target directory exists before writing the repository file. | |
# This makes the script more robust, especially in minimal environments | |
# where /etc/yum.repos.d might not be pre-created. | |
mkdir -p /etc/yum.repos.d/ | |
# Write the CentOS 6.10 repository configuration to the specified file. | |
# Using a 'here document' (heredoc) with quoted EOF ('-EOF') ensures | |
# the content is written verbatim, preserving '$basearch' for yum |
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
{ | |
"listeners": { | |
"*:8080": { | |
"pass": "routes/main" | |
} | |
}, | |
"routes": { | |
"main": [ | |
{ | |
"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
# Environment variables for PostgreSQL containers | |
x-default-pg-env: &default-pg-env | |
# Set the timezone to Asia/Bangkok | |
TZ: Asia/Bangkok | |
# Username for the PostgreSQL administrative account | |
POSTGRESQL_USERNAME: postgres | |
# Name of the default PostgreSQL database | |
POSTGRESQL_DATABASE: postgres | |
# Password for the PostgreSQL administrative account | |
POSTGRESQL_PASSWORD: mysecretpassword |
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
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ | |
// © bouroo | |
//@version=5 | |
strategy("Turtle Trading Strategy with Supertrend Confirmation", overlay=true, pyramiding=0) // Pyramiding set to 0 to prevent multiple entries for the same direction | |
// --- Strategy Parameters --- | |
// Turtle Trading Parameters | |
length1 = input.int(20, title="Donchian Channel Length (Breakout)", minval=1) | |
length2 = input.int(10, title="Donchian Channel Length (Exit)", minval=1) |
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/env/bash | |
# Thailand | |
speedtest -s 27203 | |
# Singapore | |
speedtest -s 2054 |
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 bash | |
# Exit immediately if a command exits with a non-zero status. | |
set -e | |
# Find the device containing the root filesystem (e.g., /dev/sda3 or /dev/mapper/vg-root) | |
ROOT_FS_DEVICE=$(findmnt -n -o SOURCE /) | |
# Check if ROOT_FS_DEVICE was found | |
if [ -z "$ROOT_FS_DEVICE" ]; then | |
echo "Error: Could not determine root filesystem device." |
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
use std::{ | |
fs::File, | |
io::{self, Write}, | |
str, | |
}; | |
use pcsc::{Attribute, Card, Context, Error, Scope, ShareMode}; | |
use charmap::WINDOWS_874; | |
// Data field commands (label, command APDU) | |
const FIELDS: &[(&str, [u8; 7])] = &[ |