This file contains 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
cmd /v:on /c "set i=0 & for %f in (*.jpg) do (set /a i+=1 & set "num=00!i!" & set "num=!num:~-2!" & ren "%f" "!num!.jpg")" |
This file contains 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
.galleryAlt { | |
.gallery-grid { | |
display: flex; | |
justify-content: center; | |
flex-wrap: wrap; | |
gap: 25px; | |
.gallery-grid__row { | |
display: flex; | |
flex-basis: calc(calc(100% / 3) - calc(50px / 3)); | |
margin-bottom: 0; |
This file contains 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
Get-ChildItem -Directory | ForEach-Object { | |
$Folder = $_ | |
$i = 1 | |
Get-ChildItem $Folder -File | ForEach-Object { | |
$NewName = "{0:D2}.jpg" -f $i++ | |
# Check if the file is already named correctly | |
if ($_.Name -ne $NewName) { | |
$NewPath = Join-Path $Folder.FullName $NewName | |
# Check if a file with the new name already exists to avoid overwriting | |
if (-Not (Test-Path $NewPath)) { |
This file contains 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
option[value=$#]*>{$#} |
This file contains 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 glob | |
# Replace this with your directory path | |
base_directory = "./body/corrective-body-contouring/" | |
# Loop through each folder in the directory | |
for folder in os.listdir(base_directory): | |
folder_path = os.path.join(base_directory, folder) | |
This file contains 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
# Define the path to the root of your PHP projects | |
$rootPath = "./" | |
# Define the file pattern to search for | |
$filePattern = "*.php" | |
# Function to fix the SEO title in a file | |
function Fix-SeoTitle { | |
param ( | |
[string]$filePath |
This file contains 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 json | |
# Specify the directory you want to search in | |
directory_path = "./" | |
# Function to list all folders in a directory | |
def list_folders(directory): | |
folder_list = [] | |
for root, dirs, files in os.walk(directory): |
This file contains 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
# Get the list of directories in the current folder | |
$directories = Get-ChildItem -Directory | Sort-Object Name | |
# Temporary name for renaming | |
$tempName = "tempDir" | |
# Rename directories to temporary names in reverse order | |
for ($i = 0; $i -lt $directories.Count; $i++) { | |
$newName = "{0:D2}" -f ($directories.Count - $i) | |
Rename-Item $directories[$i].Name $tempName$newName |
This file contains 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 sys | |
def rename_directories_to_sequential_numbers(path): | |
if not os.path.isdir(path): | |
print(f"The provided path '{path}' is not a valid directory.") | |
return | |
dirs = [d for d in os.listdir(path) if os.path.isdir(os.path.join(path, d))] | |
dirs.sort() |
This file contains 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 re | |
# Function to lowercase everything within the 'lazy-src' attribute in an HTML file | |
def lowercase_lazy_src(file_path): | |
with open(file_path, 'r', encoding='utf-8') as file: | |
content = file.read() | |
# Use regular expression to find all 'lazy-src' attributes and lowercase their values | |
modified_content = re.sub(r'lazy-src="([^"]+)"', lambda match: f'lazy-src="{match.group(1).lower()}"', content, flags=re.IGNORECASE) |
NewerOlder