Skip to content

Instantly share code, notes, and snippets.

View kguidonimartins's full-sized avatar

Karlo Guidoni kguidonimartins

View GitHub Profile
@kguidonimartins
kguidonimartins / docx2md.md
Last active December 2, 2016 20:02 — forked from jesperronn/docx2md.md
Convert a Word Document into MD

Converting a Word Document to Markdown in One Move

The Problem

A lot of important government documents are created and saved in Microsoft Word (*.docx). But Microsoft Word is a proprietary format, and it's not really useful for presenting documents on the web. So, I wanted to find a way to convert a .docx file into markdown.

Installing Pandoc

On a mac you can use homebrew by running the command brew install pandoc.

The Solution

# Enconding: ISO-8859-1
# rm(list = ls())
# Este script teve como base a seguinte página: http://renatabrandt.github.io/EBC2015/PCA.html
# https://gist.github.com/stevenworthington/3178163
ipak <- function(pkg){
new.pkg <- pkg[!(pkg %in% installed.packages()[, "Package"])]
if (length(new.pkg))
install.packages(new.pkg, dependencies = TRUE)
@kguidonimartins
kguidonimartins / raspagem_site_342.R
Last active August 9, 2017 13:03
script para raspagem dos dados disponíveis em https://342agora.org.br/
# AUTOR: KARLO GUIDONI MARTINS
# CONTRIBUIÇÃO: GUSTAVO HENRIQUE DE CARVALHO
# DATA: 07 DE AGOSTO DE 2017
# RASPAGEM NOMES, DECISÕES, ESTADOS E PARTIDOS DOS DEPUTADOS FEDERAIS.
# DADOS DISPONÍVEIS NO SÍTIO ELETRÔNICO: "https://342agora.org.br/"
ipak <- function(pkg)
{
# https://gist.github.com/stevenworthington/3178163
@kguidonimartins
kguidonimartins / Makefile
Created January 16, 2018 15:53 — forked from ramnathv/Makefile
R Markdown to IPython Notebook
example.md: example.Rmd
./knit
example.ipynb: example.md
notedown example.md | sed 's/%%r/%%R/' > example.ipynb
@kguidonimartins
kguidonimartins / ipak.R
Last active October 26, 2018 20:53 — forked from stevenworthington/ipak.R
Install and load multiple R packages at once
# ipak function: install and load multiple R packages.
# Check to see if packages are installed.
# Install them if they are not, then load them into the R session.
# Forked from: https://gist.github.com/stevenworthington/3178163
ipak <- function(pkg) {
new.pkg <- pkg[!(pkg %in% installed.packages()[, "Package"])]
if (length(new.pkg)) {
install.packages(new.pkg, dependencies = TRUE)
}
@kguidonimartins
kguidonimartins / github_issues_to_csv.py
Last active May 17, 2018 12:50 — forked from patrickfuller/github_issues_to_csv.py
Export Issues from Github repo to CSV (API v3)
"""
Exports issues from a list of repositories to individual csv files.
Uses basic authentication (Github username + password) to retrieve issues
from a repository that username has access to. Supports Github API v3.
Forked from: patrickfuller/github_issues_to_csv.py
"""
import argparse
import csv
from getpass import getpass
import requests
@kguidonimartins
kguidonimartins / pacotes.R
Last active May 27, 2019 15:18
Pacotes para o curso de introdução ao RMarkdown
ipak <- function(pkg){
new.pkg <- pkg[!(pkg %in% installed.packages()[, "Package"])]
if (length(new.pkg))
{
install.packages(new.pkg,
dependencies = TRUE,
repos = "https://cloud.r-project.org")
}
suppressPackageStartupMessages(sapply(pkg, require, character.only = TRUE))
}
---
title: "World maps"
output:
html_document:
df_print: paged
---
```{r echo = FALSE, message = FALSE}
library(tidyverse)
library(sf)
@kguidonimartins
kguidonimartins / onedrive-ubu.sh
Created February 9, 2019 11:41 — forked from glmdev/onedrive-ubu.sh
A bash script to setup OneDrive integration with GNOME on Ubuntu.
#!/bin/sh
# onedrive-ubu.sh
# A BASH script to set up OneDrive integration with GNOME on Ubuntu
# Copyright (C) 2018 Garrett Mills (garrett@glmdev.tech)
# This software is licensed under the MIT License.
# This sofware is provided without warranty or even any implied intent of purpose.
#
# OnedriveD: https://github.com/xybu/onedrived-dev
ipak <- function(pkg) {
new.pkg <- pkg[!(pkg %in% installed.packages()[, "Package"])]
if (length(new.pkg)){
install.packages(new.pkg, dependencies = TRUE)
}
suppressPackageStartupMessages(sapply(pkg, require, character.only = TRUE))
}
ipak(c("tidyverse", "leaflet"))