Skip to content

Instantly share code, notes, and snippets.

View antonioJASR's full-sized avatar
💭
Grug

Antonio Sánchez antonioJASR

💭
Grug
View GitHub Profile
#! /usr/bin/env python
# See http://preshing.com/20130115/view-your-filesystem-history-using-python
import optparse
import os
import fnmatch
import time
# Parse options
parser = optparse.OptionParser(usage='Usage: %prog [options] path [path2 ...]')
parser.add_option('-g', action='store', type='long', dest='secs', default=10,
@antonioJASR
antonioJASR / gist:7862427
Created December 8, 2013 19:11
Error compiling c++ code in maverick
s.h:40:11: fatal error:
'errno.h' file not found
# include <errno.h>
^
1 error generated.
@antonioJASR
antonioJASR / expswitch.markdown
Created May 11, 2014 04:17
A Pen by José Antonio Sánchez Reynaga.
@antonioJASR
antonioJASR / info.plist
Created March 9, 2016 23:34 — forked from mlynch/info.plist
Disable App Transport Security in iOS 9
<!--
This disables app transport security and allows non-HTTPS requests.
Note: it is not recommended to use non-HTTPS requests for sensitive data. A better
approach is to fix the non-secure resources. However, this patch will work in a pinch.
To apply the fix in your Ionic/Cordova app, edit the file located here:
platforms/ios/MyApp/MyApp-Info.plist
And add this XML right before the end of the file inside of the last </dict> entry:
@antonioJASR
antonioJASR / reaction.log
Created March 10, 2016 19:40
Reaction log stacktrace
AntonioMacMachine:reaction joanzare$ reaction
Starting Reaction.
[[[[[ ~/projects/temp/georgieboy/reaction ]]]]]
=> Started proxy.
=> Started MongoDB.
/Users/joanzare/.meteor/packages/meteor-tool/.1.1.10.1b51q9m++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/fibers/future.js:245
throw(ex);
^
@antonioJASR
antonioJASR / README.md
Created March 25, 2016 04:37 — forked from dannguyen/README.md
Using Google Cloud Vision API to OCR scanned documents to extract structured data

Using Google Cloud Vision API's OCR to extract text from photos and scanned documents

Just a quickie test in Python 3 (using Requests) to see if Google Cloud Vision can be used to effectively OCR a scanned data table and preserve its structure, in the way that products such as ABBYY FineReader can OCR an image and provide Excel-ready output.

The short answer: No. While Cloud Vision provides bounding polygon coordinates in its output, it doesn't provide it at the word or region level, which would be needed to then calculate the data delimiters.

On the other hand, the OCR quality is pretty good, if you just need to identify text anywhere in an image, without regards to its physical coordinates. I've included two examples:

####### 1. A low-resolution photo of road signs

<!doctype html>
<html ng-app="app">
<head>
<meta charset="utf-8">
<title>WebApp</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
<!-- build:css(.) styles/vendor.css -->
@antonioJASR
antonioJASR / init.vim
Created July 6, 2016 16:16
My custom neovim file
"*****************************************************************************
"" NeoBundle core
"*****************************************************************************
if has('vim_starting')
set nocompatible " Be iMproved
" Required:
set runtimepath+=~/.config/nvim/bundle/neobundle.vim/
endif