Skip to content

Instantly share code, notes, and snippets.

View gusanthiago's full-sized avatar

Gustavo Santos Thiago gusanthiago

View GitHub Profile
@gusanthiago
gusanthiago / belajornada.cpp
Created May 27, 2017 14:22
Questoes parcialmente aceitas
#include <bits/stdc++.h>
using namespace std;
#define maxn 100010
const int inf = 0x3f3f3f3f;
int main () {
int n;
int nova;
vector<int> numeros;
@gusanthiago
gusanthiago / getFile.py
Created May 26, 2017 18:34
Modificado arquivo de exemplo do pdfminer para ler um pdf do banco central
"""
Extract PDF text using PDFMiner. Adapted from
http://stackoverflow.com/questions/5725278/python-help-using-pdfminer-as-a-library
"""
# nao esqueca de instalar a biblioteca Pedro
# modificado de acordo com a doc == https://github.com/euske/pdfminer/
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter#process_pdf
from pdfminer.pdfpage import PDFPage
from pdfminer.converter import TextConverter
@gusanthiago
gusanthiago / getImageOpenUri.rb
Created May 17, 2017 07:57
Image get and save open uri
require 'open-uri'
open('file_name_uri.png', 'wb') do |file|
file << open('https://uva.onlinejudge.org/templates/hm_yaml_2_5/img/onlinejudgelogo2.png').read
end
@gusanthiago
gusanthiago / intercambio-ordenacao.cpp
Created April 24, 2017 02:54
maratonaInterna2015fatecsjc-algunsexers
#include <bits/stdc++.h>
using namespace std;
typedef struct {
double nota;
int falta;
string nome;
}aluno;
@gusanthiago
gusanthiago / getImage.rb
Created April 12, 2017 01:20
Requisita uma imagem de um dominio e salva
require 'net/http'
port = 8080
Net::HTTP.start("domain", port) do |http|
resp = http.get("/img/cam.jpg")
open("file_name.jpg", "wb") do |file|
file.write(resp.body)
end
end
/**
* b64
* @description - converte texto ou objeto para base64
*
* @param {Object[]} - objeto DOM de entrada
*
* @return base64 do grafico
*/
var b64 = function(obj){