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
// add following in .eslintrc.js | |
'prettier/prettier': [ | |
'error', | |
{ | |
endOfLine: 'auto', | |
}, | |
], | |
// in android\gradle\wrapper\gradle-wrapper.properties |
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 { v2 as cloudinary } from 'cloudinary'; | |
import fs from 'fs'; | |
cloudinary.config({ | |
cloud_name: process.env.CLOUDINARY_CLOUD_NAME, | |
api_key: process.env.CLOUDINARY_API_KEY, | |
api_secret: process.env.CLOUDINARY_API_SECRET, | |
}); | |
const uploadToCloudinary = async (localFilePath) => { |
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
yt-dlp -x --audio-format mp3 --extract-audio --audio-quality 0 video_url |
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 $ = (selector) => { | |
if (!selector || typeof selector !== "string") { | |
return; | |
} | |
const els = document.querySelectorAll(selector); | |
if (els.length > 1) { | |
return els; | |
} else if (els.length === 1) { | |
return els[0]; |
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 os | |
import argparse | |
def generate_text_files(directory, init_text): | |
# Create a list of image files in the directory | |
image_extensions = ['.jpg', '.jpeg', '.png', '.gif', '.bmp'] | |
image_files = [f for f in os.listdir(directory) if os.path.isfile(os.path.join(directory, f)) and os.path.splitext(f)[1].lower() in image_extensions] | |
# Iterate through the image files | |
for image_file in image_files: |
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
function getRandomNumber(min, max) { | |
return Math.floor(Math.random() * (max - min + 1)) + min; | |
} |
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
export default (element, defaultHeight) => { | |
if (element) { | |
const target = element.target ? element.target : element; | |
target.style.height = defaultHeight; | |
target.style.height = `${target.scrollHeight}px`; | |
} | |
}; |
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 argparse | |
from pydub import AudioSegment | |
import math | |
import os | |
def split_audio_file(file_path, num_pieces): | |
# Load the audio file | |
audio = AudioSegment.from_file(file_path) | |
# Calculate the duration of each piece |
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
#Make sure your dataset looks like x.txt, x.jpg, y.txt, y.png, z.txt, z.jpeg.....etc | |
import os | |
# Set the path to your dataset directory | |
dataset_directory = './dataset' | |
# Loop through the files in the dataset directory | |
for filename in os.listdir(dataset_directory): | |
if filename.endswith('.txt'): | |
# Get the full path of the text file |
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
[CmdletBinding()] | |
param ( | |
[Parameter(Mandatory=$true,Position=0)] | |
[int]$f | |
) | |
for ($i=1; $i -le $f; $i++) { | |
New-Item -ItemType File -Path "$i.txt" | |
} |
NewerOlder