Skip to content

Instantly share code, notes, and snippets.

@La5u
La5u / ocr_clip.ps1
Created October 25, 2025 14:04
extract text from image in clipboard, and overwrite the clipboard with OCR (using tesseract)
Add-Type -AssemblyName System.Windows.Forms
Add-Type -AssemblyName System.Drawing
$image = [Windows.Forms.Clipboard]::GetImage()
if ($image) {
$tmp = [IO.Path]::Combine($env:TEMP, "clip_ocr.png")
$image.Save($tmp, [System.Drawing.Imaging.ImageFormat]::Png)
$tesseract = "C:\Program Files\Tesseract-OCR\tesseract.exe"
$tmpBase = [IO.Path]::Combine($env:TEMP, "clip_ocr_" + [IO.Path]::GetRandomFileName())
@La5u
La5u / console logger.py
Created January 18, 2025 08:03
Copies the exact way something was typed
# Credits to Jac_k#2257 for original program
import msvcrt
import time
print('\nPress ctrl+t to stop typing:')
content = char = ''
times = []
while char != b'\x14':