Skip to content

Instantly share code, notes, and snippets.

# OCR PDF file
ocrmypdf -l ces input.pdf output.pdf
# -l => language: -l eng+deu, -l ces
# --sidecar => Generate text files that contain the same text recognized by OCR
# --title TITLE => Set document title (place multiple words in quotes)
# --author AUTHOR => Set document author
# --subject SUBJECT => Set document subject description
# --keywords KEYWORDS => Set document keywords
@garcon
garcon / fullScreen.js
Created April 23, 2021 15:53
Run browser in full screen mode
// JavaScript
document.getElementsByTagName("html")[0].webkitRequestFullScreen();
// document.getElementsByTagName("html")[0].requestFullscreen();
// document.getElementsByTagName("html")[0].msRequestFullscreen();
@garcon
garcon / seo-slug.php
Last active April 13, 2022 10:48
Change any string into SEO friendly URL slug
<?php
// example code
setlocale(LC_CTYPE, 'cs_CZ');
$str = "Běloučký kůň úpěl ďábelské ódy $ ' 1234";
print
preg_replace('/(?<=-)-+/', '', // Replace all duplicase hyphens with one only
preg_replace( '/[^-a-z0-9]/', '', // Strip all non-alfanumeric characters or hyphens