<?php
$content = preg_replace('#(href=['"][^'"]*)/(?='|")#', '$1', $content);
<a\s[^>]*href=['"]?https?://[^?\s'">]+\K/(?=[?\s'">])
javascript: navigator.clipboard.writeText(location.origin.replace(/\/$/, ''));null;
#( UrlRootSlashRemove
WatchClipboard: "/https?:\/\/.*\.[a-zA-Z0-9]+\//"
Action:
CLIPBOARD 1- CLIPBOARD! \ Получаем строку из буфера обмена, уменьшаем её длину на один с конца и записываем обратно в буфер обмена
)#
D:\nnCron\nncron.exe -ns -dir D:\nnCron
nncron.tab
(ПКМ на иконке > Редактировать > Crontab: nncron.tab). При сохранении кронтаба использовать кодировку ASCII CP1251, не UTF8. Регексп для ссылки простой - не стал искать большой и сложный. cd C:\2
$clipboardText = Get-Clipboard -Format Text
anyflip-downloader
# Используйте $clipboardText здесь
return random_name + '.pdf' # Добавляем расширение .pdf к случайному имени
import random
import os
def generate_random_name():
characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'
random_name = ''
for i in range(10):
random_name += random.choice(characters)
return random_name
def rename_file(file_path):
new_name = generate_random_name()
directory = os.path.dirname(file_path)
new_file_path = os.path.join(directory, new_name)
os.rename(file_path, new_file_path)
return new_file_path
file_path = 'C:\\2\out.pdf'
new_file_path = rename_file(file_path)
print(f'Файл переименован в {new_file_path}')
import random
import os
def generate_random_name():
characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'
random_name = ''
for i in range(10):
random_name += random.choice(characters)
return random_name + '.pdf'
def rename_file(file_path):
new_name = generate_random_name()
directory = os.path.dirname(file_path)
new_file_path = os.path.join(directory, new_name)
os.rename(file_path, new_file_path)
return new_file_path
file_path = 'C:\\2\\out.pdf'
new_file_path = rename_file(file_path)
print(f'Файл переименован в {new_file_path}')
import os
import glob
# sort by change date
def sort(path, ext="*.jpg"):
files = glob.glob(os.path.join(path, ext))
files.sort(key=os.path.getmtime)
return files
# rename files
def rename(path):
_sorted = sort(path)
for i, file_path in enumerate(_sorted, 1):
folder, old_name = os.path.split(file_path)
new_name = f"{i}.jpg"
new_path = os.path.join(folder, new_name)
os.rename(file_path, new_path)
print(f"Rename {old_name} to {new_name}")
if __name__ == "__main__":
# path to dir with images
folder_path = "/path/to/dir/images"
rename(folder_path)
RewriteRule ^product/([^/]+)\.html$ /replace.php [L]
<?php
if (preg_match('#^/product/([^/]+)\.html#', $_SERVER['REQUEST_URI'], $match)) {
$str = $match[1];
$str = str_replace('ja', 'ya', $str);
$str = str_replace('_', '-', $str);
header("Location: https://site.ru/shop/{$str}/", true, 301);
die();
}
RewriteCond ya$1 ^(ya)(.*)ja(.*)|^ya(.*)
RewriteCond -%2%1%3%4 ^(-)(.*)_(.*)|^-(.*)
RewriteCond -%2%1%3%4 ^(-)(.*)_(.*)|^-(.*)
RewriteRule ^product/([^/]+)\.html$ https://site.ru/shop/%2%1%3%4/ [R=301,L]
Не нравитсо именно это
Invalid default value for 'post_date'
RewriteCond %{QUERY_STRING} (?:^|&)page_id\=430(?:$|&)
RewriteRule ^$ /proekty/olimpiada\-uchiteley\-matematiki/? [L,R=301]