Skip to content

Instantly share code, notes, and snippets.

View yutannihilation's full-sized avatar
🍣
Nobody loves you

Hiroaki Yutani yutannihilation

🍣
Nobody loves you
View GitHub Profile
library(ggplot2)
library(grid)
size <- unit(70, "points")
x_orig <- unit(0.5, "npc")
y_orig <- unit(0.5, "npc")
gp1 <- gpar(col = "white", fill = "#CEF09D", lwd = 3.3)
gp2 <- gpar(col = "white", fill = "#1C646D", lwd = 3.3)
library(grid)
rect <- function(size, rot_deg) {
theta <- (c(1 / 4, 3 / 4, 5 / 4, 7 / 4) - rot_deg / 360) * pi
rectGrob(x = size * sqrt(2) * sin(theta),
y = size * sqrt(2) * cos(theta))
}
size <- unit(100, "points")
x_orig <- unit(0.5, "npc")
#| dev: ragg_png
library(grid)
library(ggplot2)
# gpar everywhere to rule out an "invisible lines" issue
gp <- gpar(col = "black", fill = "transparent", lwd = 2, lty = "solid")
mm_rel <- function(...) {
unit(0.5, "npc") + unit((base::c(...) - 0.5) * 10, "mm")
deps <- pkgdepends::new_pkg_installation_proposal(".", config = list(sysreqs = TRUE, sysreqs_lookup_system = FALSE))
deps$solve()
any(vapply(deps$get_sysreqs(), \(x) "cargo" %in% names(x), logical(1L)))

1. List up non-APIs

$ Rscript -e 'cat(tools:::nonAPI, sep = "\n")' | sort -u > nonAPI.txt
$ cat nonAPI.txt
AllDevicesKilled
Brent_fmin
OutDec
PRIMOFFSET
RC_fopen
@yutannihilation
yutannihilation / zzz.R
Last active July 31, 2022 03:22
東京都新型コロナウィルス陽性患者発表数
#| fig.width: 12
#| fig.height: 8
#| dpi: 100
#| dev: ragg_png
library(readr)
library(dplyr, warn.conflicts = FALSE)
library(ggplot2)
f <- \(...) scale_colour_viridis_d(option = "F", end = 0.94, direction = -1, ..., aesthetics = c("colour", "fill"))
library(ggplot2)
library(patchwork)
library(dplyr, warn.conflicts = FALSE)
d <- string2path::string2path("R", "Arial")
max_dist <- 0.003
d2 <- d |>
group_by(glyph_id, path_id) |>
{
"builders": [
{
"type": "virtualbox-iso",
"vm_name": "freebsd100-packer",
"boot_wait": "10s",
"disk_size": 10240,
"guest_os_type": "FreeBSD_64",
"iso_checksum": "fd25619fa0d69c29bea8347b1070ac75",
"iso_checksum_type": "md5",
library(ggplot2)
f <- systemfonts::system_fonts() |>
dplyr::filter(family == "Iosevka", style == "Heavy") |>
dplyr::pull(path)
d_pkg <- string2path::string2fill("arrow", f[1], tolerance = 0.01) |>
dplyr::mutate(
fill = as.integer(triangle_id + 50 * runif(dplyr::n()))
library(ggplot2)
library(string2path)
library(dplyr, warn.conflicts = FALSE)
library(gganimate)
f <- systemfonts::system_fonts()
# This is reproducible but only on my laptop, sorry for my laziness...
set.seed(100)
some_fonts <- sample(f$path[tools::file_ext(f$path) %in% c("ttf", "otf")], 30)