Skip to content

Instantly share code, notes, and snippets.

View emordonez's full-sized avatar

Eric Ordonez emordonez

View GitHub Profile
@emordonez
emordonez / newpost.py
Created May 13, 2021 20:10
Use this script with a Nuxt Content site to emulate Hugo's use of archetypes to create new content. Easily extendable with different templates for different types of content.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from datetime import date
from string import punctuation
from sys import argv
import pathlib
import yaml
@emordonez
emordonez / philippine-regional-gdp.R
Last active May 11, 2021 21:31
Example breakdown of PSA data on regions of the Philippines by GDP.
if (!require("pacman")) install.packages("pacman")
pacman::p_load(
"dplyr", "ggplot2", "readr", "reticulate",
"sf", "showtext", "stringr"
)
# Utility function to save ggplots
save_image <- function(filename, plot, width = 7, height = 7) {
ggsave(
sprintf("%s.png", filename),
@emordonez
emordonez / asean-gdp-comparisons.R
Last active May 13, 2021 16:17
Example analysis and visualizations of World Bank data for ASEAN GDP indicators.
if (!require("pacman")) install.packages("pacman")
pacman::p_load("dplyr", "ggplot2", "readr", "reticulate", "showtext")
# Utility function to save ggplots
save_image <- function(filename, plot, width = 7, height = 7) {
ggsave(
sprintf("%s.png", filename),
plot,
width = width, height = height,
units = "in", dpi = 96
@emordonez
emordonez / transfermarkt-visualizations.R
Last active December 7, 2022 03:45
Sample visualizations of European soccer transfer data from Transfermarkt, created with R and ggplot2. See the README for the source repo and data set.
# Setup
source("./transfers-0.R")
# Premier League 2020/21
source("./transfers-1.R")
# Big Six spending
source("./transfers-2.R")
# Most expensive transfers
source("./transfers-3.R")
# Premier League trend
source("./transfers-4.R")