Skip to content

Instantly share code, notes, and snippets.

[
{
"func": "metadata",
"value": {
"code": "x = 1 + 1",
"id": "a"
},
"label": "<r-chunk>"
},
{
{
"tldrawFileFormatVersion": 1,
"schema": {
"schemaVersion": 2,
"sequences": {
"com.tldraw.store": 4,
"com.tldraw.asset": 1,
"com.tldraw.camera": 1,
"com.tldraw.document": 2,
"com.tldraw.instance": 25,
## query sizes
typst query test.typ --input strings='["foo", "$ alpha = beta / (gamma + x^2)$"]' '<dimensions>' --field value
## produce images
typst compile test.typ --input strings='["foo", "$ alpha = beta / (gamma + x^2)$"]' '{p}.svg'
#!/bin/bash
# Exit on error
set -e
# Parse options
LAYOUT="3x4" # default
while getopts "l:" opt; do
case ${opt} in
l ) LAYOUT="$OPTARG" ;;
@baptiste
baptiste / cornu.R
Created April 16, 2025 10:26
cornu spiral for course banners
library(ggplot2)
library(pracma)
library(ggplot2)
# remotes::install_github('houyunhuang/ggvwline')
library(grid)
library(vwline)
library(gggrid)
bump <- function(t) ifelse(abs(t)<1, exp(-1/(1-t^2)), 0)
library(purrr)
library(ggplot2)
library(tibble)
# https://community.wolfram.com/groups/-/m/t/2575939
x <- function(t, m, gamma, epsilon0, q, epsilon) {
numerator <- m * epsilon0 * exp(-gamma * t / m) * (
(epsilon * q * exp(gamma * t / m)) - (gamma * sin((epsilon * q * t) / m)) - (epsilon * q * cos((epsilon * q * t) / m))
)
---
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: [email protected]
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.