Skip to content

Instantly share code, notes, and snippets.

View sahithyen's full-sized avatar

Sahithyen Kanaganayagam sahithyen

View GitHub Profile
@sahithyen
sahithyen / example.md
Created January 29, 2021 15:37
Use mermaid in jsdoc tutorials
<script src="./jsdoc-tuts-mermaid.js"></script>

This is an example on how to add an mermaid in a JSDoc-Tutorial.

Make sure to add the script in the markdown, add the script in the staticFiles folder and set it up accodingly in the jsdoc config file as shown in the gist.

You then can add mermaids in the same way as in GitLab:

@sahithyen
sahithyen / note-freq-map.json
Created March 27, 2017 17:31
Map of the frequencies of musical notes (A4 = 440 Hz)
{
"C0": 16.35,
"C#0": 17.32,
"D0": 18.35,
"Eb0": 19.45,
"E0": 20.6,
"F0": 21.83,
"F#0": 23.12,
"G0": 24.5,
"Ab0": 25.96,
var canvas = document.querySelector('.myCanvas');
var ctx = canvas.getContext('2d');
var
canvasWidth = 400,
canvasHeight = 300;
// Calculate how much more pixels are needed
var devicePixelRatio = window.devicePixelRatio || 1;
var backingStoreRatio = ctx.backingStorePixelRatio || 1;