Skip to content

Instantly share code, notes, and snippets.

@eugrus
eugrus / ocrde.py
Last active August 29, 2025 15:37
from PIL import Image
import pytesseract
import sys
if len(sys.argv) < 2:
sys.exit(1)
image_path = sys.argv[1]
image = Image.open(image_path)
text = pytesseract.image_to_string(image, lang="deu")
@eugrus
eugrus / Vertragspunkte.ps1
Last active August 19, 2025 08:39
Konversion von manuellen Nummerierungsebenen in Listenebenen
function KillHeadLessWord {
$sessionId = [System.Diagnostics.Process]::GetCurrentProcess().SessionId
Get-Process -Name WINWORD -ErrorAction SilentlyContinue |
Where-Object { $_.MainWindowHandle -eq 0 -and $_.SessionId -eq $sessionId } |
Stop-Process -Force
}
function ProgressWindow {
Add-Type -AssemblyName System.Windows.Forms
$form = New-Object System.Windows.Forms.Form
@eugrus
eugrus / excel2json.py
Last active July 28, 2025 15:24
Platzhalter anhand einer Tabelle füllen
import pandas as pd
pd.read_excel('PH.xlsx').to_json('PH.json', orient='records', indent=4, force_ascii=False)
@eugrus
eugrus / 1a.ps1
Created July 18, 2025 08:42
Replace double paragraph breaks with single ones in an open MS Word document.
# Скрипт для замены двойных переводов абзаца на одинарные в открытом документе MS Word
# Функция для подключения к Word
function Connect-ToWord {
try {
# Попытка подключиться к уже запущенному экземпляру Word
$word = [System.Runtime.InteropServices.Marshal]::GetActiveObject("Word.Application")
Write-Host "Interop connection..." -ForegroundColor Green
return $word
}
rpm2cpio $1 | cpio -idmv
javascript:document.querySelectorAll('*').forEach(el => {const color = getComputedStyle(el).color; const rgb = color.match(/\d+/g);if (rgb && rgb.length === 3) {const [r, g, b] = rgb.map(Number);if (g > r + 30 && g > b + 30) {el.style.color = 'blue';}}});
#!/usr/bin/pwsh
param ([double]$netto)
$brutto = $netto*1.19
Write-Output ("{0:F2}" -f $brutto)
https://www.archives.gov/files/research/jfk/releases/2025/0318/104-10003-10041.pdf
https://www.archives.gov/files/research/jfk/releases/2025/0318/104-10004-10143%20(C06932208).pdf
https://www.archives.gov/files/research/jfk/releases/2025/0318/104-10004-10143.pdf
https://www.archives.gov/files/research/jfk/releases/2025/0318/104-10004-10156.pdf
https://www.archives.gov/files/research/jfk/releases/2025/0318/104-10004-10213.pdf
https://www.archives.gov/files/research/jfk/releases/2025/0318/104-10005-10321.pdf
https://www.archives.gov/files/research/jfk/releases/2025/0318/104-10006-10247.pdf
https://www.archives.gov/files/research/jfk/releases/2025/0318/104-10007-10345.pdf
https://www.archives.gov/files/research/jfk/releases/2025/0318/104-10009-10021.pdf
https://www.archives.gov/files/research/jfk/releases/2025/0318/104-10009-10222.pdf
param(
[string]$filePath
)
# Ensure the file exists
if (-not (Test-Path $filePath)) {
Write-Error "File does not exist: $filePath"
exit 1
}
javascript:window.location.pathname=window.location.pathname.replace(/^\/[a-z]{2}-[a-z]{2}\//,'/en-us/');