@trumpsear_tg · Post #1806 · 20.11.2025 г., 23:00
Who is taller? #Trump#Conspiracy 👂More on Trump's Ear
Hashtags
TGINSIGHT SIMILAR POSTS
Изворен канал @pythonotes · Post #121 · 20 јул.
Регулярно требуется преобразовать какой-либо текст в максимально совместимый текст для URL, имени файла, имени объекта в каком-то софте и тд. Требования совместимости простые: в тексте должны быть только допустимые символы. Обычно это a-z, 0-9 и "_" или "-". То есть, только прописные буквы латинского алфавита и цифры (как пример). Допустим, нам нужно название статьи в блоге преобразовать в slug для добавления его в URL этой статьи. Как это лучше всего сделать? В Django по умолчанию есть готовая функция slugify для таких случаев. Но я её никогда не использую. Почему? Потому что её недостаточно! Приведём пример >>> from django.utils.text import slugify >>> slugify('This is a Title') 'this-is-a-title' Пока всё отлично >>> slugify('This is a "Title!"') 'this-is-a-title' Спец символы удалились, всё хорошо. >>> slugify('Это заголовок статьи') '' Вот и приехали 😢. Если текст не английский то буквы просто игнорируются. Можно это поправить >>> slugify('Это заголовок статьи', allow_unicode=True) 'это-заголовок-статьи' Но тогда мы не вписываемся в условие. У нас появилась кириллица в тексте. Так как я часто пишу сайты для русскоязычных пользователей эта проблема весьма актуальна. Я не использую стандартную функцию и всегда пишу свою. Оригинал я не беру в расчёт и пишу полностью свою функцию. И так, по порядку: 🔸1. Исходный текст: >>> text = 'Мой заголовок №10 😁!' Взял специально посложней со специальными символами. 🔸2. Транслит Необходимо сделать транслит всех символов в латиницу. Здесь очень выручает библиотека unidecode. Помимо простого транслита кириллицы в латиницу она умеет преобразовывать спец символы и иероглифы в текстовые аналоги. from unidecode import unidecode >>> unidecode("Ñ Σ ® µ ¶ ¼ 月 山") 'N S (r) u P 1/4 Yue Shan' Очень крутая библиотека, советую👍 В нашем случае получаем такое преобразование: >>> text = unidecode(text) >>> print(text) 'Moi zagolovok No. 10 !' Отличный транслит. Смайл просто удалился, хотя я ждал что-то вроде :). Ну и ладно, всë равно невалидные символы. А еще наш код уже поддерживает любой язык, будь то хинди или корейский. 🔸4. Фильтр символов Unidecode не занимается фильтрацией по недопустимым символам. Это мы делаем в следующем шаге через regex. Просто заменим все символы на "_" если они вне указанного диапазона. >>> text = re.sub(r'[^a-zA-Z0-9]+', '_', text) >>> print(text) 'Moi_zagolovok_No_10_' Символ "+" в паттерне выручает когда несколько недопустимых символов идут рядом. Все они заменяются на один символ "_". 🔸5. Slugify Осталось удалить лишние символы по краям и сделать нижний регистр >>> text = text.strip('_').lower() >>> print(text) 'moi_zagolovok_no_10' Получаем отличный slug! 😎 🌎 Полный код в виде функции. ______________ PS. Проверку что в строке остался хоть один допустимый символ я бы вынес в отдельную функцию. #libs#tricks#django
Пребарај: #conspiracy
@trumpsear_tg · Post #1806 · 20.11.2025 г., 23:00
Who is taller? #Trump#Conspiracy 👂More on Trump's Ear
Hashtags
@images · Post #1918 · 22.09.2025 г., 09:40
🍿 The Chair Company: Tim Robinson Turns Office Life Into a Hotbed of Conspiracies 📆Premiere: October 13, 2025 🎭Genre: #Comedy · #Conspiracy ✈️Follow series Tim Robinson, the mastermind behind I Think You Should Leave and Detroiters, is back with a show that feels like a sketch stretched to the max… but with the ambition of an HBO thriller. In The Chair Company, he plays William Ronald Trosper, an office worker who, after a humiliating disaster at work, finds himself unraveling a criminal conspiracy as absurd as it is unsettling. 🤯🪑 The trailer is packed with rapid-fire one-liners, cartoonish facial expressions, and Robinson’s trademark obsession with bleak middle-class workplaces where misery flips into dark comedy. What I love most is how Robinson moves away from the usual “rich people intrigue” à la Succession and instead zeroes in on the mindset of the alienated office drone. That lens on the hopeless everyman feels as necessary as it is hilarious. If you ever thought a chair could be the center of the universe, this show is here to prove it. 🔥
Hashtags
@chaoticinternet · Post #35 · 21.02.2023 г., 18:48
https://www.piratewires.com/p/milk-wars #conspiracy#общество
Hashtags
@chaoticinternet · Post #32 · 13.02.2023 г., 16:38
https://www.youtube.com/watch?v=CQBOA061ugE #общество#conspiracy
Hashtags
@trumpsear_tg · Post #1578 · 30.09.2025 г., 14:03
Top MAGA lackey Kash Patel has made the uncharacteristically bold move of intervening in Donald Trump’s mad and rapidly mounting campaign of vengeance against his political opponents. Trump launched into a vicious Truth Social diatribe Saturday afternoon against former FBI director Christopher Wray, who he slammed for supposedly “LYING” about the presence of bureau personnel in the crowds outside the Capitol Building on Jan. 6. #Trump#conspiracy#FBI 👂More on Trump's Ear ⚠️
Hashtags
@trumpsear_tg · Post #1584 · 30.09.2025 г., 23:59
Gavin Newsom naturally couldn’t resist trolling Donald Trump after the 79-year-old president posted an AI-generated video featuring him he shilling for magic “Medbeds.” “Trump is about to shut down the government and rip health care from 20 million Americans. What’s he doing? Posting AI-generated slop about ‘miracle hospital beds’ that cure all illness,” tweeted Newsom, 57. “DONALD TRUMP HAS LOST IT,” he added. #Trump#Newsom#conspiracy 👂More on Trump's Ear ⚠️
Hashtags
@trumpsear_tg · Post #1579 · 30.09.2025 г., 14:05
The "Shaman of the Capitol" sued Donald Trump and the World Bank ⚖️🐂🇺🇸 Jacob Chansley, better known as the QAnon Shaman due to his horns, skin and painted face during the storming of the US Congress on January 6, 2021, decided to sue Donald Trump. The same president who pardoned him in January 2025 after 41 months in prison. 🏛📜 Chansley's lawsuit also names other defendants — the US Federal Reserve 🏦, the National Security Agency 🛰, the IMF 💵, the World Bank 🌍, the State of Israel ✡️, Elon Musk's Corporation X 🚀, T-Mobile 📱 and Warner Bros. Studios 🎬. The document itself is 26 pages long, but consists of one paragraph. In it, Chansley demands that only two laws remain in force — the Bill of Rights and the original U.S. Constitution 📖🦅. Unusual items include the idea of issuing a $40 trillion gold coin 🪙 to cover the U.S. national debt. He also claims that Trump personally sent him a letter ✉️ two days after the Capitol was stormed, and the secret services allegedly tried to use his "shamanic abilities" ✨ for contacts "out of this world" 👽. Previously, Chansley was an ardent proponent of the conspiracy theory 🔍 that Trump is fighting an elite group engaged in child sex trafficking. However, he later turned away from the president, accusing him of unwillingness to make public the "Epstein dossier." 📂 #Conspiracy#QAnon 👂More on Trump's Ear ⚠️
Hashtags
@googlefactss · Post #40155 · 21.11.2025 г., 23:01
President John F. Kennedy was assassinated on November 22, 1963. Lee Harvey Oswald was arrested for the crime but was killed two days later by Jack Ruby. Ruby was convicted of murder but died in prison before his retrial. This single act—Ruby killing Oswald—meant there was never a public trial to examine the evidence. This left countless unanswered questions and made it impossible to prove there wasn't a conspiracy. What's your theory? [Read more] @googlefactss #JFK#History#OnThisDay#conspiracy