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
| // Sequence generator function | |
| const range = (start = 0, stop = 0, step = 0) => Array.from({ length: (stop - start) / step + 1 }, (_, i) => start + (i * step)); |
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 | |
| clear_screen () { | |
| echo -en '\033[2J\033[u' | |
| } | |
| # Reset | |
| Color_rst='\033[0m' # Text Reset | |
| # Regular Colors |
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 real_ip() { | |
| if (!empty($_SERVER['HTTP_CLIENT_IP'])) { | |
| // Check IP from internet shared proxy | |
| $ip = $_SERVER['HTTP_CLIENT_IP']; | |
| } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { | |
| // Check IP from proxy | |
| $ip = $_SERVER['HTTP_X_FORWARDED_FOR']; | |
| } elseif (!empty($_SERVER['REMOTE_ADDR'])) { |
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 {String} HTML representing any number of sibling elements | |
| * @return {NodeList} | |
| */ | |
| const createElementFromHTML = (htmlString = '') => { | |
| var template = document.createElement('template'); | |
| template.innerHTML = htmlString; | |
| return template.content; | |
| } |
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
| var fadeInInterval, fadeOutInterval; | |
| const fadeOut = (element, timing=7) => { | |
| clearInterval(fadeInInterval); | |
| clearInterval(fadeOutInterval); | |
| element.fadeOut = timing => { | |
| var newValue = 1; | |
| element.style.opacity = 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
| String.prototype.reverse = function () { | |
| var str = this + ''; | |
| // Check the input is invalid | |
| if (!str || str.length < 2 || | |
| typeof str !== 'string') { | |
| return str; | |
| } | |
| // Take empty array revArray |
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 remove_duplicates = _array => { | |
| let unique = []; | |
| _array.forEach(element => { | |
| if (!unique.includes(element)) unique.push(element); | |
| }); | |
| return unique; | |
| } |
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 | |
| # Check if the script is run with superuser privileges | |
| if [ "$EUID" -ne 0 ]; then | |
| echo "Please run this script as root (sudo)." | |
| exit 1 | |
| fi | |
| # Prompt the user for the target devices | |
| read -p "Enter the target devices (e.g., /dev/sdX /dev/sdY): " target_devices |
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
| import speech_recognition as sr | |
| from pydub import AudioSegment | |
| audio_file = "your_audio_file_path_here.mp3" | |
| sound = AudioSegment.from_mp3(audio_file) | |
| sound.export("output.wav", format="wav") | |
| recognizer = sr.Recognizer() | |
| with sr.AudioFile("output.wav") as source: | |
| audio_data = recognizer.record(source) |
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 | |
| // checking the exists Library. | |
| if (!file_exists("finglish.php")) { | |
| copy('https://raw.githubusercontent.com/hctilg/finglish/main/index.php', 'finglish.php'); | |
| } | |
| header('Access-Control-Allow-Origin: *'); | |
| header('Content-Type: application/json'); | |
| $response = []; |