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

#!/bin/bash
MYSQL_USER="root"
MYSQL_PASS="1234"
MAIL="[email protected]"
REMOTE_REPOSITORY=https://bitbucket.org/username/backup-banco
DIRECTORY="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "$DIRECTORY"
COMMIT_COUNT=`git rev-list HEAD --count`
@lira
lira / proxy.js
Created June 2, 2017 18:09 — forked from soutar/proxy.js
Redirect HTTP traffic on Internet Sharing to a local Charles proxy
#!/usr/bin/env node
var options = require('minimist')(process.argv.slice(2), { default: {
cport: 8888
}});
var disable = options.disable || options.d;
var enable = options.enable || options.e;
var status = options.s || options.status;
var child = require('child_process');

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 / gist:f4bfd8561a64b5cbc851d36ff06eaefe
Created October 27, 2017 16:59 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@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 / postman-update.sh
Last active November 2, 2024 20:18 — forked from jcharlier/postman-update.sh
Install/Update postman or postman canary (beta) for linux. Tested in ubuntu 17.10 gnome3
#!/bin/bash
cd /tmp || exit
read -r -p "[s]table or [b]eta? [sS/bB] " choice
choice=${choice,,} # tolower
if [[ ! "$choice" =~ ^(s|b)$ ]]; then
exit
fi
if [[ "$choice" = "s" ]]; then
url=https://dl.pstmn.io/download/latest/linux64
name=Postman