Skip to content

Instantly share code, notes, and snippets.

@r0dos
r0dos / take-screenshot-mac.py
Created December 1, 2024 10:48 — forked from dougbacelar/take-screenshot-mac.py
Take screenshot of specific window on MacOS with python
from Quartz import CGWindowListCopyWindowInfo, kCGNullWindowID, kCGWindowListOptionAll
import cv2 as cv
import numpy
from time import time
from PIL import Image
import os
windowId = None
windowName = 'Desktop'
@r0dos
r0dos / capture_darwin.py
Created December 1, 2024 10:47 — forked from mr-linch/capture_darwin.py
Make fast screenshot of Mac OS window from Python (using native api bindings, 30 fps on Air M2)
import Quartz as QZ
import Quartz.CoreGraphics as CG
import AppKit as AK
import numpy as np
import numpy.typing as npt
import typing as t
Matcher = t.Callable[[dict[str, t.Any]], bool]
@r0dos
r0dos / gzip.go
Created May 10, 2021 19:46 — forked from alex-ant/gzip.go
golang: gzip and gunzip
package main
import (
"bytes"
"compress/gzip"
"fmt"
"io"
"log"
)