Last active
February 12, 2016 16:57
-
-
Save pauljz/9590a38bcae9b53eceee to your computer and use it in GitHub Desktop.
Revisions
-
pauljz revised this gist
Feb 12, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -27,4 +27,4 @@ while true; do echo "$OCR_TEXT" echo "$OCR_TEXT" | pbcopy fi done -
pauljz revised this gist
Feb 12, 2016 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,6 +10,9 @@ fi if ! hash fswatch 2>/dev/null; then brew install fswatch fi if ! hash convert 2>/dev/null; then brew install imagemagick fi while true; do SCREENSHOT=$(fswatch -1 ~/Desktop | grep '/Screen Shot') @@ -24,4 +27,4 @@ while true; do echo "$OCR_TEXT" echo "$OCR_TEXT" | pbcopy fi done -
pauljz revised this gist
Feb 12, 2016 . 1 changed file with 11 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,12 +12,16 @@ if ! hash fswatch 2>/dev/null; then fi while true; do SCREENSHOT=$(fswatch -1 ~/Desktop | grep '/Screen Shot') if [ "$SCREENSHOT" ]; then echo "Running OCR on $SCREENSHOT..." convert "$SCREENSHOT" -resize 300% -set colorspace Gray -separate -average -sigmoidal-contrast 10x60% ~/ss.tif OCR_TEXT=$( tesseract ~/ss.tif stdout 2> /dev/null | sed 's/ //g' | # Remove spaces sed 's/O/0/g' # Replace O with 0 ) echo "$OCR_TEXT" echo "$OCR_TEXT" | pbcopy fi done -
pauljz revised this gist
Feb 12, 2016 . 1 changed file with 7 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,9 +12,12 @@ if ! hash fswatch 2>/dev/null; then fi while true; do OCR_TEXT=$(fswatch -1 ~/Desktop \ | grep '/Screen Shot' \ | xargs -I {} sh -c "convert '{}' -resize 300% -set colorspace Gray -separate -average -sigmoidal-contrast 10x60% ~/ss.tif | tesseract ~/ss.tif stdout") if [ "$OCR_TEXT" ]; then echo $OCR_TEXT | sed 's/ //g' echo $OCR_TEXT | sed 's/ //g' | pbcopy fi done -
pauljz created this gist
Feb 11, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ #!/bin/bash # Install homebrew and dependencies if missing... if ! hash brew 2>/dev/null; then ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" fi if ! hash tesseract 2>/dev/null; then brew install tesseract fi if ! hash fswatch 2>/dev/null; then brew install fswatch fi while true; do OCR_TEXT=$(fswatch -1 ~/Desktop | grep '/Screen Shot' | xargs -I {} tesseract {} stdout) if [ "$OCR_TEXT" ]; then echo $OCR_TEXT echo $OCR_TEXT | pbcopy fi done