Skip to content

Instantly share code, notes, and snippets.

View jennyknuth's full-sized avatar

Jenny Knuth jennyknuth

View GitHub Profile
@jennyknuth
jennyknuth / README.md
Last active March 23, 2024 16:33
140 html color names as an array of json objects—enjoy!

HTML Colors

All 140 HTML colors as JSON objects with fields:

  • name
  • hex
  • rgb
  • families
@jennyknuth
jennyknuth / README.md
Last active March 19, 2024 20:16
Transform an SVG into a data URI—best practice

How to transform an SVG into a data URI

by Jenny Knuth, based on the work of Chris Coyier and Taylor Hunt

A data URI is a nice way to include a web resource without needing to make an HTTP request. Chris Coyier explains the technique nicely in Probably Don't Base64 SVG.

While a PNG might use Base64 encoding, for SVG, there is a better way.

Taylor Hunt's experiments led to this solution for optimizing SVGs in data URIs:

"So the best way of encoding SVG in a data URI is data:image/svg+xml,[actual data]. We don’t need the ;charset=utf-8 parameter (or the invalid ;utf8 parameter…), because URLs are always ASCII."

@jennyknuth
jennyknuth / GeoelectricTest.nc
Last active February 19, 2024 22:58
test netcdf4 data
@jennyknuth
jennyknuth / geoelectric-test.json
Created September 14, 2023 16:37
geoelectric data for September 2017 storm
This file has been truncated, but you can view the full file.
{
"metadata": {
"time": {
"units": "milliseconds since 1970-01-01"
},
"latitude": {
"units": "degrees north"
},
"longitude": {
"units": "degrees east"
@jennyknuth
jennyknuth / D3.js-heat-map-tutorial.md
Last active March 6, 2023 18:19
How to make a heat map like GitHub's commit chart with D3.js

Make a heat map graphic with D3.js

This gist contains the code to create a simple "heat map" with D3.js. In this case, the "heat map" is a graph showing activity distributed over the days of the week on one axis and the weeks of the year on the other.

d3 heat map graphic

This gist is meant to be used as part of a workshop where the code is uncommented as the workshop progresses.

It could also be used as a puzzle outside of a workshop: follow the clues to reconstruct the correct code and make it work!

@jennyknuth
jennyknuth / model-description.md
Created December 8, 2022 18:12
temporary documentation for DstLIVE

Dst Model Description

Overview

DstLive is a model for real-time predictions of the Dst Geomagnetic index. The 'ground-truth' for Dst is assumed to be the one issued by the World Data Center for Geomagnetism, Kyoto (https://wdc.kugi.kyoto-u.ac.jp/dstdir/).

DstLive predicts Dst from 1 to 6 hours ahead, with associated probabilities. The model is based on multi-fidelity boosted neural networks (Hu, Camporeale, Swiger, 2022), that ingest real-time data solar wind observed by ACE at the 1st Lagrangian point (https://www.swpc.noaa.gov/products/ace-real-time-solar-wind). In addition, the time history of Dst is used.

Operational set up

The model requires the latest observed Dst to produce a forecast. However, that value is not immediately available at the top of an hour. Hence, the model runs every 15, 30, 45 minutes past the hour, checking if the Dst for that hour has been released from Kyoto. However, in the current version, forecasts are always issued for top of the hour times, regardless of whe

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.