Skip to content

Instantly share code, notes, and snippets.

View lira's full-sized avatar
🐢
Working from home

Fernando Lira lira

🐢
Working from home
View GitHub Profile
@lira
lira / post-merge
Last active August 29, 2015 14:06 — forked from danielcosta/post-merge
#/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` or `git merge` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
@lira
lira / Sublime Text 2.md
Last active August 29, 2016 14:13
Sublime Text

UNSAVED LOCATION

  • OS X: ~/Library/Application Support/Sublime Text 2/Settings/
  • Windows: %APPDATA%\Sublime Text 2\Settings\
  • Linux: ~/.config/sublime-text-2/Settings/
@lira
lira / Imagens.md
Last active September 27, 2016 14:40
Imagens aqui!

Imagens!gorila

@lira
lira / README.md
Created March 1, 2017 18:02 — forked from dannguyen/README.md
Using Python 3.x and Google Cloud Vision API to OCR scanned documents to extract structured data

Using Python 3 + 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

Keybase proof

I hereby claim:

  • I am lira on github.
  • I am lira (https://keybase.io/lira) on keybase.
  • I have a public key ASB6F1y5wpAT-17vanaRHH1ghNS0h3smjF1A8V4CzEUbDAo

To claim this, I am signing this object:

@lira
lira / encrypt_openssl.md
Created January 22, 2018 17:55 — forked from dreikanter/encrypt_openssl.md
File encryption using OpenSSL

Symmetic encryption

For symmetic encryption, you can use the following:

To encrypt:

openssl aes-256-cbc -salt -a -e -in plaintext.txt -out encrypted.txt

To decrypt:

@lira
lira / mysql2sqlite.sh
Created April 23, 2018 18:57 — forked from esperlu/mysql2sqlite.sh
MySQL to Sqlite converter
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite
@lira
lira / remove-mingw-text-from-git-bash-prompt.md
Created January 19, 2019 14:43 — forked from raduserbanescu/remove-mingw-text-from-git-bash-prompt.md
Remove "MINGW" text from Git Bash prompt and window title

Remove "MINGW" text from Git Bash prompt and window title

Quickly remove the text without having to create a custom prompt.

Edit the file: C:\Program Files\Git\etc\profile.d\git-prompt.sh

 else
        TITLEPREFIX=$MSYSTEM
 fi
@lira
lira / tmux-cheatsheet.markdown
Created April 3, 2019 20:15 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@lira
lira / 2018-https-localhost.md
Created October 30, 2019 13:56 — forked from cecilemuller/2019-https-localhost.md
How to create an HTTPS certificate for localhost domains

How to create an HTTPS certificate for localhost domains

This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.

Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).