Instantly share code, notes, and snippets.
rojvv /concat_bench.ts
CreatedJune 24, 2023 11:29
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
// Install Deno: https://deno.land. | |
// Run with the command | |
// deno bench | |
constarray1=crypto.getRandomValues(newUint8Array([1024*1024])); | |
constarray2=crypto.getRandomValues(newUint8Array([1024*1024])); | |
constarray3=crypto.getRandomValues(newUint8Array([1024*1024])); | |
constarray4=crypto.getRandomValues(newUint8Array([1024*1024])); | |
constarray5=crypto.getRandomValues(newUint8Array([1024*1024])); |
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
importtype{Browser}from"https://deno.land/x/puppeteer@9.0.2/mod.ts"; | |
// I do not like having the functions here as class methods because they are meant to be used as utilities. | |
// But you could have them in a class. :) | |
constendpoint="https://twitter.com"; | |
/** | |
* Visits Twitter and signs in with the provided credentials if not already signed in. | |
*/ |
ffmpeg -re -i<your_input> -c:v libx264 -c:a aac -f flv<stream_url>/<stream_key>
-re
reads the input at native frame rate, doing this isrecommended by FFmpeg.-c:v libx264
encodes the video of the output inlibx264
, the required video encoding by Telegram.-c:a aac
encodes the audio of the output inaac
, the required audio encoding by Telegram.-f flv
sets the format of the output toflv
, the required format by Telegram.
rojvv /your_first_python_telegram_bot.py
Last activeDecember 28, 2022 08:49
یەکەم بۆتی تەلەگرامت بە پایسۆن 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
fromtelegram.extimportUpdater,CommandHandler,MessageHandler,Filters | |
defstart(update,context): | |
update.message.reply_text( | |
"تۆ منت دەست پێ کرد!" | |
) | |
defecho(update,context): |