Skip to content

Instantly share code, notes, and snippets.

View mauleyzaola's full-sized avatar

Mauricio Leyzaola mauleyzaola

View GitHub Profile
@mauleyzaola
mauleyzaola / read_from_stdin.go
Last active June 11, 2022 21:00
Reads from stdin pipe
func ReadFromStdIN() (io.ReadCloser, error) {
info, err := os.Stdin.Stat()
if err != nil {
return nil, err
}
if info.Mode()&os.ModeNamedPipe == 0 {
return nil, fmt.Errorf("no pipe")
}
return os.Stdin, nil
}
@mauleyzaola
mauleyzaola / iterate_pdf_content_python.md
Created June 9, 2022 06:37 — forked from somada141/iterate_pdf_content_python.md
Iterate over decoded PDF page content with Python

Introduction

This note shows how to iteratively retrieve the decoded content of the pages in a PDF file using Python and the pdfminer Python package.

At the time of writing, the latest version of pdfminer was used, i.e., 20140328. Thus, as the package seems poorly maintained and prone to API-breaking changes one may have to explicitly install this version for the following code to work.

Code

The following generator will iterate over a PDF file under a given filename and iteratively yield the text content of each PDF page:

@mauleyzaola
mauleyzaola / jwtRS256.sh
Created July 23, 2021 23:27 — forked from ygotthilf/jwtRS256.sh
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@mauleyzaola
mauleyzaola / How to Install JDK MacOS Homebrew.md
Created June 2, 2021 10:56 — forked from gwpantazes/How to Install JDK MacOS Homebrew.md
How to install different JDK versions on MacOS with Homebrew

How To Install Different JDK Versions on MacOS with Homebrew

Keywords: Java, JDK (Java Development Kit), MacOS, Homebrew, Specific Version

This how-to guide covers how to install different versions of the JDK on MacOS with Homebrew.

Table of Contents

@mauleyzaola
mauleyzaola / github_actions_golang.md
Created May 20, 2021 10:39 — forked from Harold2017/github_actions_golang.md
github actions golang, build, test, codecov

build

name: build
on: [push]
jobs:

  build:
    name: Build
    runs-on: ubuntu-latest