Skip to content

Instantly share code, notes, and snippets.

@Sheep-y
Sheep-y / puella_magi_pickup_odds.js
Last active February 6, 2019 09:48
Puella Magi Magia Record Pickup Chance Calculator
/* For Puella Magi Magia Record. Developed with node.js.
Calculate the odds of getting 1 to 4 pickup character (4 stars magi) from a pickup card pool.
A random 4 stars magi is guarenteed after 99 misses, which is reset if you get one early.
Excel file with chart is available at https://drive.google.com/open?id=1GSJMw-lOM1u7DMVT-Gi_lsxgJS4kLfE_
Example output at 60% pickup:
Draw @ Percentile of 4 pickups
236 @ 10.023
308 @ 25.24
400 @ 50.035
514 @ 75.007
@Sheep-y
Sheep-y / jsPDF.code39.md
Last active July 9, 2021 11:38
Code 39 barcode drawing function for jsPDF

Adds a jsPDF method to draw a Code 39 barcode in line vector, which is very small and retain perfect sharpness at all resolutions. An optional matrix can be supplied for rotation, sheer, mirror, or other effects.

Does not render text; the drawn barcode is perfectly rectangular. Does not validate text input. Requires EcmaScript 7.

Usage

const doc = new jsPDF();
// Draw at [50,50], width 100. height 20.

doc.code39( "0123456789", 50, 30, 100, 20 );