Skip to content

Instantly share code, notes, and snippets.

@me-suzy
me-suzy / GENIAL INTERSECTION.py
Created September 5, 2025 06:25
GENIAL INTERSECTION.py
import os
import re
from collections import defaultdict
# Define directories
base_dir = r'e:\Carte\BB\17 - Site Leadership\alte\Ionel Balauta\Aryeht\Task 1 - Traduce tot site-ul\Doar Google Web\Andreea\Meditatii\2023\Intersection\test'
ro_dir = os.path.join(base_dir, 'ro')
en_dir = os.path.join(base_dir, 'en')
# Function to extract canonical from HTML content
@me-suzy
me-suzy / Intersection Principal NOU 2.py
Created September 5, 2025 06:19
Intersection Principal NOU 2.py
import os
import re
from collections import defaultdict
# Define directories
base_dir = r'e:\Carte\BB\17 - Site Leadership\Principal 2022'
ro_dir = os.path.join(base_dir, 'ro')
en_dir = os.path.join(base_dir, 'en')
# Function to extract canonical from HTML content
@me-suzy
me-suzy / intersection BUN.py
Created September 4, 2025 22:25
intersection BUN.py
import os
import re
from collections import defaultdict
# Define directories
base_dir = r'e:\Carte\BB\17 - Site Leadership\Principal 2022'
ro_dir = os.path.join(base_dir, 'ro')
en_dir = os.path.join(base_dir, 'en')
# Function to extract canonical from HTML content
@me-suzy
me-suzy / replace increment.php
Created September 4, 2025 22:05
replace increment.php
<?php
$to_be_replaced = 'wxyz'; // exactly what it wants replaced
$nr_start = 1; // from which no start counting
$path_files = getcwd();
// echo $path_files;
$excluded_files = array(
'.htaccess',
'robots.txt',
'.ftpquota',
'dezabonare.html',
@me-suzy
me-suzy / inlocuire 235.php
Created September 4, 2025 22:05
inlocuire 235.php
<?php
$de_inlocuit = 'wxyz'; // exact ce se doreste inlocuit
$nr_start = 1; // de la ce nr sa inceapa numaratoarea
$cale_fisiere = getcwd();
// echo $cale_fisiere;
$fisiere_excluse = array(
'.htaccess',
'robots.txt',
'.ftpquota',
'dezabonare.html',
@me-suzy
me-suzy / 567587.py
Created September 4, 2025 15:58
567587.py
import os
import re
def fix_specific_cross_reference():
"""Repară cross-reference-ul specific pentru exemplul tău"""
# Fișierul EN care trebuie reparat
en_file = r'e:\Carte\BB\17 - Site Leadership\Principal 2022\en\the-eyes-see-the-world-the-heart-feels-it-deep-down.html'
correct_ro_filename = 'ochii-vad-lumea-inima-o-simte-pana-in-adanc.html'
@me-suzy
me-suzy / 6dfhe54.py
Created September 4, 2025 15:46
6dfhe54.py
import os
import re
def test_one_file():
"""Test pe un singur fișier să văd exact ce se întâmplă"""
# Testez fișierul pe care l-ai menționat
test_file = r'e:\Carte\BB\17 - Site Leadership\Principal 2022\ro\ochii-vad-lumea-inima-o-simte-pana-in-adanc.html'
if not os.path.exists(test_file):
@me-suzy
me-suzy / aproape bun find and replace.py
Last active September 4, 2025 11:37
PERFECT find and replace
import os
import re
from pathlib import Path
ro_directory = r'e:\Carte\BB\17 - Site Leadership\Principal\ro'
en_directory = r'e:\Carte\BB\17 - Site Leadership\Principal\en'
def read_file_with_fallback_encoding(file_path):
encodings = ['utf-8', 'latin1', 'cp1252', 'iso-8859-1']
for encoding in encodings:
@me-suzy
me-suzy / alt searchbun.py
Created September 4, 2025 10:02
alt searchbun.py
import os
import re
from pathlib import Path
ro_directory = r'e:\Carte\BB\17 - Site Leadership\Principal\ro'
en_directory = r'e:\Carte\BB\17 - Site Leadership\Principal\en'
def read_file_with_fallback_encoding(file_path):
encodings = ['utf-8', 'latin1', 'cp1252', 'iso-8859-1']
for encoding in encodings:
@me-suzy
me-suzy / replaceasasas.py
Last active September 4, 2025 07:27
replaceasasas
import os
import re
from pathlib import Path
ro_directory = r'e:\Carte\BB\17 - Site Leadership\Principal\ro'
en_directory = r'e:\Carte\BB\17 - Site Leadership\Principal\en'
def read_file_with_fallback_encoding(file_path):
encodings = ['utf-8', 'latin1', 'cp1252', 'iso-8859-1']
for encoding in encodings: