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 img2pdf # run pip install img2pdf | |
img = "" # Local image file location | |
f = open('output.pdf', 'wb') | |
f.write(img2pdf.convert(img)) # Writes pdf file in the root directory | |
f.close() |
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 | |
import validators | |
url = input("Enter a YouTube URL: ") | |
if not validators.url(url): | |
raise ValueError("Please enter a correct URL.") | |
if not "youtube" in url: |
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 os | |
import subprocess | |
if not os.path.exists("assets"): | |
raise Exception("Please create and put all your vidoes in assets folder!") | |
mkv_list = os.listdir("assets") | |
if not os.path.exists("result"): | |
os.mkdir("result") |
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 os | |
import subprocess | |
if not os.path.exists("assets"): | |
raise Exception("Please create and put all your vidoes in assets folder!") | |
mkv_list = os.listdir("assets") | |
if not os.path.exists("result"): | |
os.mkdir("result") |
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
for mkv in mkv_list: | |
name, ext = os.path.splitext(mkv) | |
if ext != ".mkv": | |
raise Exception("Please add MKV files only!") | |
output_name = name + ".mp4" | |
try: | |
subprocess.run( | |
["ffmpeg", "-i", f"assets/{mkv}", "-codec", "copy", f"result/{output_name}"], check=True | |
) |
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
# pip install git+https://github.com/nficano/pytube@5d2c1a4e756cd8bac373867bf673155e691f1e04 | |
from pytube import YouTube | |
import time | |
start_time = time.time() | |
previous = 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
/* | |
Most cards use an algorithm invented by Hans Peter Luhn of IBM. According to Luhn’s algorithm, you can determine if a credit card number is (syntactically) valid as follows: | |
1. Multiply every other digit by 2, starting with the number’s second-to-last digit, and then add those products’ digits together. | |
2. Add the sum to the sum of the digits that weren’t multiplied by 2. | |
3. If the total’s last digit is 0 (or, put more formally, if the total modulo 10 is congruent to 0), the number is valid! | |
*/ | |
#include <stdio.h> |
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
#include <ctype.h> | |
#include <cs50.h> | |
#include <stdio.h> | |
#include <string.h> | |
// Points assigned to each letter of the alphabet | |
int POINTS[] = {1, 3, 3, 2, 1, 4, 2, 4, 1, 8, 5, 1, 3, 1, 1, 3, 10, 1, 1, 1, 1, 4, 4, 8, 4, 10}; | |
int compute_score(string word); |
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
#include <stdio.h> | |
#include <cs50.h> | |
#include <string.h> | |
#include <ctype.h> | |
#include <math.h> | |
int letterCounter(char paragraph[], int); | |
int wordCounter(char paragraph[], int); | |
int sentenceCounter(char paragraph[], int); |
OlderNewer