Skip to content

Instantly share code, notes, and snippets.

---
title: Wizard • pointy-hatted • pipe smoker
author: Gandalf the Grey
alsoknown: Olórin, Gandalf
nationality: Maia, bearer of Narya
age: Born before Arda was created
currentdate: fourth age
address: Valinor, Arda
mobile: flying moths
email: mithrandir@istari.me
library(ggplot2)
my_axis = function() {
structure("test",
class = c("element_custom","element_blank", "element") # inheritance test workaround
)
}
library(grid)
# returns a gTree with desired text
---
name: "Pumpkins and peanuts committee"
date: "03/01/2000"
time: "2 pm"
location: "baseball field"
invited:
- Sally
- Shroeder
- Pig-pen
- Marcie
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@baptiste
baptiste / hexaweb.R
Last active November 10, 2023 16:40
library(ggforce)
library(purrr)
library(tibble)
library(gganimate)
web_strand <- function(side = 1, bend = 0.5, angle = 0, start = c(0,0)){
pos <- cbind(x=c(0, 1, 2), y = bend*c(0, 2, 0))
post <- pos %*% matrix(c(cos(angle), -sin(angle), sin(angle), cos(angle)), ncol=2, byrow=TRUE)
xt <- post[,1] + start[1]
yt <- post[,2] + start[2]
\documentclass[a4paper,10pt]{article}
\usepackage[a4paper]{geometry}
\geometry{textwidth=16cm}
\usepackage{enumitem}
\setlist[description]{font=\scshape\bfseries\rmfamily, leftmargin=2cm,
style=multiline,itemsep=6pt,parsep=2pt}
\begin{document}
---
title: "Untitled"
format:
pdf:
latex-tinytex: false
keep-md: true
keep-tex: true
fontsize: "11"
---
---
title: "random die fraction"
---
```{r}
fifth <- '<svg xmlns="http://www.w3.org/2000/svg" height="42px" width="42px"><rect stroke="black" fill="none" x="1px" y="1px" stroke-width="2px" rx="5px" width="40px" height="40px"></rect> <circle stroke="black" fill="black" cy="30px" cx="30px" r="5px"></circle> <circle stroke="black" fill="black" cy="30px" cx="10px" r="5px"></circle> <circle stroke="black" fill="black" cy="20px" cx="20px" r="5px"></circle> <circle stroke="black" fill="black" cy="10px" cx="30px" r="5px"></circle> <circle stroke="black" fill="black" cy="10px" cx="10px" r="5px"></circle> </svg>'
```
Sure, I can display you
library(ggplot2)
library(grid)
element_box_break <- function (fill=NULL, colour = NULL, linewidth = NULL, linetype = NULL, lineend = NULL,
color = NULL, arrow = NULL, inherit.blank = FALSE) {
if (!is.null(color))
colour <- color
if (is.null(arrow))
arrow <- FALSE
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd">
<language name="Julia" section="Scientific"
version="0"
extensions="*.jl"
mimetype="text/x-juliascript"
author="Andreas Nordal (andreas.nordal@gmail.com)"
license="public domain">
<highlighting>