Skip to content

Instantly share code, notes, and snippets.

@Caster
Caster / README.md
Last active August 29, 2015 14:15
Demonstration of extended padAngle parameters for D3JS.

This shows how to create a sunburst chart that has some padding between the inner ring segments that extends outwards, while the outer rings do not have inner padding. This was previously possible already, but then the shape of the padding would be triangular, because the padding would be x radians. This example has straight edge padding, thanks to an extension of the svg.arc.padAngle function, that now also accepts an array as argument. The first element of that array would then be the left angle padding, while the right angle padding can be given separately as the second element of that array. This gives more flexibility, which is demonstrated in this example.

The color schemes in this example are taken from ColorBrewer.

@Caster
Caster / script.user.js
Last active December 26, 2017 11:34
A GreaseMonkey/TamperMonkey version of the `math-with-slack` script.
// ==UserScript==
// @name MathJax on Slack
// @namespace https://github.com/fsavje/math-with-slack
// @description Renders math on Slack using MathJax. Based on github:fsavje/math-with-slack.
// @include https://*.slack.com/messages/*
// @version 1
// @grant none
// ==/UserScript==
// See: https://github.com/fsavje/math-with-slack

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@Caster
Caster / README.md
Created March 24, 2021 11:51
A simple calculator (SCW TU/e March 2021)

Example usage:

$ python arith.py 1 + 1
2
$ python arith.py 3 x 4
12
$ python arith.py 5 + 4 x 3
17
$ python arith.py 4 / 2