This file contains hidden or 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 av | |
import cv2 | |
import numpy as np | |
import time | |
from collections import deque, OrderedDict | |
from threading import Thread, Lock, Event | |
from IPython.display import display, clear_output, Image as DispImage | |
class RTSPBatchDecoder: |
This file contains hidden or 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 cv2 | |
import av | |
import numpy as np | |
from IPython.display import display, clear_output, Image as DispImage | |
def imshow(frame): | |
""" | |
Display a frame inline in Jupyter; each call replaces the previous one. | |
No matplotlib, no ipywidgets required. | |
""" |
This file contains hidden or 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
#!/bin/bash | |
# Function to print colored docker ps table | |
print_colored_docker_ps() { | |
# List of readable color codes | |
local colors=(31 32 33 34 35 36 91 92 93 94 95 96) | |
declare -A project_colors | |
# Print table header | |
printf "%-12s\t%-30s\t%-40s\t%s\n" "CONTAINER ID" "NAMES" "IMAGE" "STATUS" |
This file contains hidden or 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
# usage: python crack_pdf_password.py --pdf EAadhaar.pdf --age 70 | |
import itertools | |
import multiprocessing | |
from multiprocessing import Manager, Pool | |
from tqdm import tqdm | |
from PyPDF2 import PdfReader | |
import time | |
import threading | |
import argparse |
This file contains hidden or 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
// YT Tutorial: https://youtu.be/im3rWaN_2Qo | |
import { useReducer } from "react"; | |
const readObject = (obj, path) => { | |
let val = null; | |
if (path.includes(".")) { | |
path | |
.split(".") | |
.map((path) => (val = val ? val[path] || null : obj[path] || null)); | |
return val; |
This file contains hidden or 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
// Find the video element that is supposed to play the stream | |
const videoElement = document.querySelector('video'); | |
if (videoElement) { | |
const stream = videoElement.srcObject; | |
// Check if the stream is available and active | |
if (stream instanceof MediaStream && stream.active) { | |
// Get video tracks from the stream | |
const videoTracks = stream.getVideoTracks(); |
This file contains hidden or 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
{ | |
"editor.formatOnSave": true, | |
"python.formatting.provider": "black", | |
"python.formatting.blackPath": "<path-to-black-formatter>" | |
} |
This file contains hidden or 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
version: "3.8" | |
services: | |
app: | |
image: nvidia/cuda:11.6.2-base-ubuntu20.04 | |
command: nvidia-smi | |
deploy: | |
resources: | |
reservations: | |
devices: |
This file contains hidden or 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 asyncio | |
import fractions | |
import logging | |
import threading | |
import time | |
from typing import Optional, Set, Tuple | |
import av | |
from av import AudioFrame, VideoFrame | |
from aiortc.mediastreams import AUDIO_PTIME, MediaStreamError, MediaStreamTrack |
NewerOlder