Skip to content

Instantly share code, notes, and snippets.

@tilltnet
tilltnet / script.R
Created April 17, 2025 19:41
Download PDFs from providers.anthem.com
# libs --------
library(jsonlite)
library(tidyverse)
# urls --------
base_url <- "https://providers.anthem.com"
json_url <- "https://providers.anthem.com/sites/Satellite?d=Universal&pagename=getdocuments&brand=BCCNYE&state=&formslibrary=gpp_formslib"
# headers -----
# A session ID is required to successfully send http GET requests to the server. You can copy a session ID from your browser's inspector network tab. The session ID below might be expired at this point.
@tilltnet
tilltnet / gist:2226c7003b1472d35fab236255814b98
Created August 6, 2024 05:04
Filter alter-alter ties before density calculatio
---
title: "Filter alter-alter ties"
format: html
---
Create a minimal `egor` object as an example.
```{r}
library(egor)
@tilltnet
tilltnet / gist:eb45a743fe8adfffafff0205ad279c98
Created July 11, 2022 22:36
bash find *.RProj as clickable list
alias frp="find ~/Dropbox/ ~/ -type f -path '*/.*' -prune -o -not -name '.*' -type f -iname '*\.rproj' -print | sed -e 's/^/file:\/\//' | sed -e 's/ /%20/g'"
@tilltnet
tilltnet / edge_gravity.R
Last active June 29, 2020 16:46
This is an implementation and reproduction of the edge gravity alogrithm and some results presented in Helander, M. E., & McAllister, S. (2018). The gravity of an edge. Applied Network Science, 3(1). https://doi.org/10.1007/s41109-018-0063-6.
find_possible_paths <- function(g, k = NULL, ksp = c("baerde", "yenpathy")) {
undirected <- FALSE
if (!igraph::is.directed(g)) {
undirected <- TRUE
weight <- igraph::E(g)$weight
e_l <- as.data.frame(igraph::as_edgelist(g))
l_e <- as.data.frame(cbind(e_l[, 2], e_l[, 1]))
e_l_l_e <- rbind(e_l, l_e)
@tilltnet
tilltnet / kill_rstudio_rsessions.R
Last active November 8, 2019 15:42
R Script that kills instances of R related to RStudio Sessions
# This script uses lswin.py from sjitech/mac_list_windows_pids to get
# a list of all running RStudio Sessions and their titles.
# https://github.com/sjitech/mac_list_windows_pids
# This script assumes that lswin.py is in your home folder.
# For convenience you should add an alias to your .bshrc or .zshrc file.
# Example alias: alias rkill="RScript ~/kill_rstudio_rsessions.R"
suppressMessages({
library(dplyr, quietly = TRUE)