Skip to content

Instantly share code, notes, and snippets.

View vdmit's full-sized avatar

Dmitry Veltishchev vdmit

  • Yandex LLC
  • Russia, Moscow
View GitHub Profile
@ctolsen
ctolsen / curl_to_ab.py
Last active June 3, 2024 11:59
"Copy to cURL" in Chrome to Apache Bench command
#!/usr/bin/env python3
import sys
import os
def curl_to_ab(curl_cmd: list, num: int=200, cur: int=4) -> str:
"""
Translate a cURL command created by Chrome's developer tools into a
command for ``ab``, the ApacheBench HTTP benchmarking tool.
@vdmit
vdmit / history_message.cpp.diff
Last active June 17, 2017 10:57
Dirty patch to disable Telegram web page preview
diff --git a/Telegram/SourceFiles/history/history_message.cpp b/Telegram/SourceFiles/history/history_message.cpp
index a318520..45ca737 100644
--- a/Telegram/SourceFiles/history/history_message.cpp
+++ b/Telegram/SourceFiles/history/history_message.cpp
@@ -709,6 +709,7 @@ void HistoryMessage::initMedia(const MTPMessageMedia *media) {
}
} break;
case mtpc_messageMediaWebPage: {
+ break; // nopreview fix
auto &d = media->c_messageMediaWebPage().vwebpage;