Every day before going to bed, I open the day's daily note (custom shortcut Ctrl+D), which has the following template:
---
exercise: -1| import numpy as np | |
| from scipy.fftpack import fftn, ifftn | |
| def get_noise(noise_type: str, shape: tuple[int, int, int]) -> np.ndarray: | |
| white_noise = np.random.randn(*shape) | |
| if noise_type == 'white': | |
| noise = white_noise | |
| else: | |
| f_transform = fftn(white_noise) |
| .callout { | |
| border-radius: 10px; /* round the edges more */ | |
| padding: 10px; | |
| } | |
| .callout-title { | |
| padding: 0px 2px; | |
| margin-top: 0px; | |
| } |
Preview:
Setup:
RawMarkdown.tsx to quartz/componentsrawmarkdown.scss to quartz/components/stylesrawmarkdown.inline.ts to quartz/components/scriptsquartz.layout.ts I put it as the last component before the body (view it in action):| #!/usr/bin/env -S uv run --script | |
| # /// script | |
| # dependencies = [ | |
| # "requests", | |
| # "pillow", | |
| # "pygame", | |
| # "numpy", | |
| # ] | |
| # requires-python = ">=3.10" | |
| # /// |