Skip to content

Instantly share code, notes, and snippets.

View sverhoeven's full-sized avatar

Stefan Verhoeven sverhoeven

View GitHub Profile
@sverhoeven
sverhoeven / __init__.py
Created August 14, 2023 12:51
Gist to see how mkdocstring inherits types from superclass attribute
class Vehicle:
"""A vehicle class
Attributes:
weight: The weight of the vehicle
"""
weight: float = 0.0
def __init__(self, weight: float) -> None:
@sverhoeven
sverhoeven / README.md
Last active March 16, 2023 06:58
Backup of images of my orgnizations on Docker Hub

Phenocam

https://phenocam.nau.edu/

Using API might need login.

Install

# Dependencies from supplemental_code/3_Figures/PS3_figures.Rmd
@sverhoeven
sverhoeven / README.md
Last active October 24, 2022 14:39
Octave with netcdf on linux
"""
Requires haddock3, fcc and pyyaml
```shell
python3 util/generate_haddock3_catalog.py > haddock3_catalog.yml
```
"""
import argparse
import importlib
@sverhoeven
sverhoeven / README.md
Created December 3, 2020 12:40
Dependency license checker report
@sverhoeven
sverhoeven / problem.cpp
Created October 7, 2020 11:51
run-cpp-on-web: webassembly
// An example equation
float equation(float x) {
return 2 * x * x * x - 4 * x * x + 6;
}
// Derivative of the above equation
float derivative(float x) {
return 6 * x * x - 8 * x;
}
@sverhoeven
sverhoeven / problem.hpp
Created October 7, 2020 11:51
run-cpp-on-web: webassembly
#ifndef H_PROBLEM_HPP
#define H_PROBLEM_HPP
float equation(float x);
float derivative(float x);
#endif
@sverhoeven
sverhoeven / app.html
Created October 2, 2020 10:13
run-cpp-on-web: kitchen-sink
<!doctype html>
<html lang="en">
<head>
<title>Root finding web application</title>
<script src="https://unpkg.com/react@16/umd/react.development.js" crossorigin></script>
<script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js" crossorigin></script>
<script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vega@5.13.0"></script>
<script src="https://cdn.jsdelivr.net/npm/vega-lite@4.13.0"></script>
<script src="https://cdn.jsdelivr.net/npm/vega-embed@6.8.0"></script>
@sverhoeven
sverhoeven / plot.jsx
Created October 2, 2020 10:12
run-cpp-on-web: kitchen-sink
function IterationsPlot({ iterations }) {
const container = React.useRef(null);
function didUpdate() {
if (container.current === null || iterations.length === 0) {
return;
}
const spec = iterations2spec(iterations);
vegaEmbed(container.current, spec);
}