Skip to content

Instantly share code, notes, and snippets.

View torreypayne's full-sized avatar

Torrey Payne torreypayne

  • Thirty Madison
  • New York, NY
View GitHub Profile
@dshorthouse
dshorthouse / ruby_ocr.rb
Last active June 12, 2024 14:16
OCR Image-based PDF in ruby
require 'parallel'
require 'rtesseract'
require 'mini_magick'
source = "/MyDirectory/my.pdf"
doc = {}
pdf = MiniMagick::Image.open(source)
Parallel.map(pdf.pages.each_with_index, in_threads: 8) do |page, idx|
tmpfile = Tempfile.new(['', '.tif'])
MiniMagick::Tool::Convert.new do |convert|
@kennwhite
kennwhite / 1944_OSS_Simple_Sabotage_Field_Manual.md
Last active May 17, 2024 09:58
1944 OSS Simple Sabotage Field Manual