Skip to content

Instantly share code, notes, and snippets.

View sergiospagnuolo's full-sized avatar
🐕‍🦺

Sérgio Spagnuolo sergiospagnuolo

🐕‍🦺
View GitHub Profile
@fernandobarbalho
fernandobarbalho / gist:0cf27d994e39700663551b2d14387b08
Created August 5, 2019 15:20
Com essa função é possível programaticamente baixar todos os dados que se queira do datasus apenas alterando os parâmetros de uma função.
hack_datasus <- function(sistema, modalidade, tipo_arquivo, ano, UF, mes){
#Função gera dataframe a partir de ftp feita na página do datasus
#sistema ex:'SIHSUS' Verificar os sistemas disponíveis em http://www2.datasus.gov.br/DATASUS/index.php?area=0901&item=1
#modalidade 'dados'
#tipo_arquivo ex: 'RD'#Varia conforme o sistema
#ano ex: 17 Dois últimos dígitos do ano
#UF ex:'AL' Sigla de UF Brasileira
#mes ex:'12' strings entre 01 e 12
@voltek62
voltek62 / api-similarweb.R
Last active June 4, 2020 16:09
get Web Traffic Data from SimilarWeb API with R
library(httr)
library(jsonlite)
# https://dataseolabs.com
# Doc : https://www.similarweb.com/corp/developer/
# Create your key here : https://pro.similarweb.com/#/account/api-management
# You can have freely 3 Months of Web Traffic Data
# conf
myList <- c("cuisineaz.com","marmiton.org","odelices.com","allrecipes.fr")
@Irio
Irio / normalize_string.py
Created December 12, 2017 15:53
normalize_string.py
import unicodedata
def normalize_string(string):
if isinstance(string, str):
nfkd_form = unicodedata.normalize('NFKD', string.lower())
return nfkd_form.encode('ASCII', 'ignore').decode('utf-8')
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
@benmarwick
benmarwick / PDF-2-text-or-CSV.r
Last active July 18, 2022 03:48
Convert PDFs to text files or CSV files (DfR format) with R
# Here are a few methods for getting text from PDF files. Do read through
# the instructions carefully! NOte that this code is written for Windows 7,
# slight adjustments may be needed for other OSs
# Tell R what folder contains your 1000s of PDFs
dest <- "G:/somehere/with/many/PDFs"
# make a vector of PDF file names
myfiles <- list.files(path = dest, pattern = "pdf", full.names = TRUE)
@yanofsky
yanofsky / LICENSE
Last active February 25, 2024 12:21
A script to download all of a user's tweets into a csv
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
@letanure
letanure / estados-cidades.json
Last active April 30, 2024 23:07
JSON estados cidades do brasil, dividido por estados. segunda lista atualizada em 2020, dados do IBGE
{
"estados": [
{
"sigla": "AC",
"nome": "Acre",
"cidades": [
"Acrelândia",
"Assis Brasil",
"Brasiléia",
"Bujari",
@jpravetz
jpravetz / product_generator.rb
Created December 2, 2011 21:24
Jekyll generator to read json data file and generate product and ingredient pages
#------------------------------------------------------------------------
# encoding: utf-8
# @(#)product_generator.rb 1.00 29-Nov-2011 16:38
#
# Copyright (c) 2011 Jim Pravetz. All Rights Reserved.
# Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
#
# Description: A generator that creates product, products and
# ingredients pages for jekyll sites. Uses a JSON data
# file as the database file from which to read and