Skip to content

Instantly share code, notes, and snippets.

View jcpsantiago's full-sized avatar
🏊

João Santiago jcpsantiago

🏊
View GitHub Profile
@jcpsantiago
jcpsantiago / Dockerfile
Created January 16, 2019 17:09
Dockerfile with packrat
FROM rocker/r-ver:3.5.1
RUN apt-get update && apt-get install -y --no-install-recommends \
## needed for git2r
libssl-dev \
## needed for curl
libcurl4-openssl-dev
ENV APP_DIR /app
## gather your data frames into a list
l <- list(cars = mtcars,
sleepy = sleep)
## export into individual CSV files
export_list <- function(list, folder = NULL) {
purrr::iwalk(
list,
~ readr::write_csv(.x, path = paste0(folder, .y, ".csv"))
)

gif-from-tweet

There are so many great GIFs out there and I want to have copies of them. Twitter makes that harder than it should be by converting them to MP4 and not providing access to the source material. To make it easier, I made a bash pipeline that takes a tweet URL and a filename, extracts the MP4 from that tweet and uses ffmpeg to convert back to GIF.

Dependencies

  • ffmpeg
    • macOS: brew install ffmpeg
    • Ubuntu/Debian: apt install ffmpeg