Skip to content

Instantly share code, notes, and snippets.

Foadsf / DownloadYouTubePlaylistSubtitles.ps1
Created May 18, 2024 20:51
PowerShell script to download and extract plain text from autogenerated subtitles of a YouTube playlist
param (
if (-not $playlistID) {
Write-Host "Please provide a playlist ID as a command-line argument."
exit 1
# Define the playlist URL and output file
from pylatexenc.latex2text import LatexNodes2Text
from nltk.probability import FreqDist
from nltk.corpus import stopwords
import argparse
import nltk
def analyze_word_frequency(filename, words_to_check):
"""Analyzes word frequency in a LaTeX document.
Foadsf /
Created April 28, 2024 20:22
A Python script and Windows batch command to recursively find and delete binary files in a directory
import os
import sys
def is_binary(filename):
Check if the file is binary. A file is considered binary if it contains a null byte
within the first 1024 bytes of its content.
you may run
FOR /F "tokens=*" %G IN ('python .') DO del "%G"
Foadsf / .gitignore
Created February 25, 2024 10:00
Efficiently manage and display your Telegram groups with our Python script. Designed for Telegram users and group administrators, this script leverages the Telethon library to fetch and print a list of groups you own directly to your console. Perfect for organization and quick access, this tool simplifies group management on Telegram—ideal for d…
Foadsf /
Created November 14, 2023 14:10
Python script using Telethon to unban removed users in a Telegram group. This script fetches the list of users who have been kicked from a Telegram group and unbans them, enabling them to rejoin. It handles rate limits and provides an efficient way to manage group memberships.
import asyncio
from import ChannelParticipantsKicked
from telethon.sync import TelegramClient
from telethon.errors import FloodWaitError
# Replace these with your own Telegram API ID and Hash
api_id = 'YOUR_API_ID'
api_hash = 'YOUR_API_HASH'
# Replace with the positive integer ID of your group (omit the '-' sign)

I want to design a vacuum table to clamp down a very thin plate and I want to know the stresses and deformations due to the atmospheric pressure. Consider the simplified model below:


a disk with radius of $r_2$ and an insignificant thickness of $h << r_2$ over a vacuum hole with a radius of $r_1$ with a $\rho_1$ filleted edge. I presume after deformation the disk should look like this:

Foadsf /
Created February 15, 2022 11:15
Implementing Brent solver instead of Newton method in thermoI.H to resolve maximum number of iterations error -->

Someone in [this page][1] has claimed to successfully implement [Brent solver][2] in [thermoI.H][3] instead of Newton solver to resolve the infamous

FOAM FATAL ERROR: Maximum number of iterations exceeded

issue. The part of code he is referring to is:

template<class Thermo, template<class> class Type>
inline Foam::scalar Foam::species::thermo<Thermo, Type>::T


Foadsf /
Last active November 24, 2023 03:25
Installing WxMaxima as a portable software on a Windows machine without admin rights.
  • Download the latest version of the software from the official website
  • unarchive the .exe file with 7zip or any other software you have
  • then go to the unarchived folder and find the bin\wxmaxima.exe, create a shortcut to on your desktop so you can run it easily next time
Foadsf / CMakeLists.txt
Last active June 21, 2020 11:13
small clinfo, fetching OpenCL platfroms and theri device's infomation
cmake_minimum_required(VERSION 3.1)
find_package(OpenCL REQUIRED)
add_executable(main main.c)
target_include_directories(main PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
Foadsf / test.adoc
Created April 4, 2020 20:34
test HTML iframe asciidoc