Skip to content

Instantly share code, notes, and snippets.

View MattiooFR's full-sized avatar

Mathieu MattiooFR

View GitHub Profile
from youtube_transcript_api import YouTubeTranscriptApi, TranscriptsDisabled, NoTranscriptFound
def get_video_id(url):
"""
Extract the video ID from a YouTube URL
"""
if 'youtube.com/watch?v=' in url:
return url.split('v=')[1]
elif 'youtu.be/' in url:
return url.split('be/')[1]
@MattiooFR
MattiooFR / mouse.py
Created August 26, 2024 12:08
Recreating mouse movements and clicks from focusee json file
import cv2
import json
import numpy as np
import os
import argparse
from tqdm import tqdm
import time
def load_json(filename):
with open(filename, 'r') as f:
@MattiooFR
MattiooFR / indent2fence.py
Last active November 12, 2021 13:55
This little program convert all the indented code blocks in a markdown file to a fenced code blocks style.
"""
This little program convert all the indented code blocks
in a markdown file to a fenced code blocks style.
It adds python language highlight argument by default.
This program is argely inspired by the php gist made by tobice
https://gist.github.com/tobice/1beab9616bb48e56ac1f1eb48c11dd97
-p, --path : path to the file to convert
-t, --type : change the language highlight for the code blocks

FWIW: I didn't produce the content presented here (the outline from Edmond Lau's book). I've just copy-pasted it from somewhere over the Internet, but I cannot remember what exactly the original source is. I was also not able to find the author's name, so I cannot give him/her the proper credits.


Effective Engineer - Notes

What's an Effective Engineer?