Skip to content

Instantly share code, notes, and snippets.

Avatar

Ilja Kocken japhir

View GitHub Profile
@japhir
japhir / roll_dnd_mobs.R
Last active Jan 26, 2022
Simulate many D&D mob rolls
View roll_dnd_mobs.R
### Introduction
# We're running a massive final D&D 5e battlefield, and would like to roll the dice!
# but having to roll 20d20 to determine if your army of archers hits is a pain
# so here is some R code to simulate dice-rolls for large groups of mobs.
# It shows you exactly what was rolled so you can still cheer on your army of champions!
# (except for individual damage dice, but I don't care too much about that)
### libraries
@japhir
japhir / elections_2020.R
Last active Nov 7, 2020
Creates a plot of trendlines of votes remaining vs difference between candidates
View elections_2020.R
library(tidyverse)
dat <- read_csv("https://github.com/alex/nyt-2020-election-scraper/raw/master/battleground-state-changes.csv")
dat <- dat %>%
group_by(state) %>%
mutate(lead_first = first(leading_candidate_name),
biden_trump = ifelse(leading_candidate_name != lead_first | leading_candidate_name == "Trump",
-vote_differential, vote_differential)) %>%
ungroup()
View gist:12ec4baff9631eb08e91350bb0ee423b
❯ pacaur -Syu
:: Synchronizing package databases...
core is up to date
extra is up to date
community is up to date
multilib is up to date
:: Starting full system upgrade...
there is nothing to do
:: Starting AUR upgrade...
:: resolving dependencies...
View LANG=C steam with steam-native-runtime
LANG=C steam
Repairing installation, linking /home/japhir/.steam/steam to /home/japhir/.local/share/Steam
/home/japhir/.local/share/Steam/steam.sh: line 154: VERSION_ID: unbound variable
/home/japhir/.local/share/Steam/steam.sh: line 154: VERSION_ID: unbound variable
Running Steam on arch 64-bit
/home/japhir/.local/share/Steam/steam.sh: line 154: VERSION_ID: unbound variable
STEAM_RUNTIME is enabled automatically
Installing breakpad exception handler for appid(steam)/version(0)
*** Error in `/home/japhir/.local/share/Steam/ubuntu12_32/steam': free(): invalid pointer: 0xffc6b600 ***
======= Backtrace: =========
View steam with LANG=C
LANG=C steam
Repairing installation, linking /home/japhir/.steam/steam to /home/japhir/.local/share/Steam
/home/japhir/.local/share/Steam/steam.sh: line 154: VERSION_ID: unbound variable
/home/japhir/.local/share/Steam/steam.sh: line 154: VERSION_ID: unbound variable
Running Steam on arch 64-bit
/home/japhir/.local/share/Steam/steam.sh: line 154: VERSION_ID: unbound variable
STEAM_RUNTIME is enabled automatically
Installing breakpad exception handler for appid(steam)/version(0)
*** Error in `/home/japhir/.local/share/Steam/ubuntu12_32/steam': free(): invalid pointer: 0xffb679e0 ***
======= Backtrace: =========
View steam-runtime
Repairing installation, linking /home/japhir/.steam/steam to /home/japhir/.local/share/Steam
/home/japhir/.local/share/Steam/steam.sh: line 154: VERSION_ID: unbound variable
/home/japhir/.local/share/Steam/steam.sh: line 154: VERSION_ID: unbound variable
Running Steam on arch 64-bit
/home/japhir/.local/share/Steam/steam.sh: line 154: VERSION_ID: unbound variable
STEAM_RUNTIME is enabled automatically
Installing breakpad exception handler for appid(steam)/version(0)
*** Error in `/home/japhir/.local/share/Steam/ubuntu12_32/steam': free(): invalid pointer: 0xffa46730 ***
======= Backtrace: =========
/usr/lib32/libc.so.6(+0x6a2fa)[0xf728d2fa]