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
function copyDivToClipboard() { | |
var range = document.createRange(); | |
range.selectNode(document.getElementById("toCopy")); | |
window.getSelection().removeAllRanges(); // clear current selection | |
window.getSelection().addRange(range); // to select text | |
document.execCommand("copy"); | |
window.getSelection().removeAllRanges();// to deselect | |
} |
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
import re | |
import itertools | |
def solve(puzzle): | |
# find all words in it | |
words = re.findall('[A-Z]+', puzzle.upper()) | |
# make a list of unique chars | |
unique_characters = set(''.join(words)) |
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
import logging | |
from telegram.ext import (Updater, Dispatcher, ConversationHandler, CommandHandler, | |
MessageHandler, RegexHandler, Filters, | |
CallbackContext,) | |
from telegram import Update, KeyboardButton, ReplyKeyboardMarkup, ReplyKeyboardRemove, ReplyMarkup | |
import requests | |
logging.basicConfig( | |
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.DEBUG |
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
from pytube import YouTube | |
source = YouTube('https://www.youtube.com/watch?v=KR0g-1hnQPA&feature=emb_logo') | |
en_caption = source.captions.get_by_language_code('en') | |
en_caption_convert_to_srt =(en_caption.generate_srt_captions()) | |
print(en_caption_convert_to_srt) |
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
from PIL import Image | |
import os | |
path = "" # path to dir of photos | |
files = os.listdir(path) | |
files = ["./{}/{}".format(path,file) for file in files] | |
im_list = [Image.open(file) for file in files ] | |
pdf1_filename = "./output.pdf" | |
im1 = im_list[0] |
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
<!DOCTYPE html> | |
<html lang="fa" dir="rtl"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Sample CSS Search</title> | |
<style> | |
table{ | |
width: 100%; | |
} |