Info
This is the MidspinJS file information and download page. MidspinJS is a small suite of questionably useful functions in Javascript. You may use them on your site if you wish (A charge of $0.04 per function call will be charged to your IP, payable to /dev/null).
Download it by clicking here
I also host it live. Copy this to the <head> section in your HTML: <script src="https://assets.midspin.net/js/midspin.js"></script>
Reference
- midspinTest()
- Basic test to see if this script suite has been loaded. Writes to console.log
- Parameters: None.
- Returns: None.
- til5()
- Summary: Shows how much time is left until 5pm local (for cube farmers).
- Parameters: None
- Returns: Time left until 5pm as array of integers [(h)h, (m)m, (s)s]. If after 5pm, returns
null
Example: (Does not pad numbers when less than 10 by default) Pad with 0s - pyth(a, b)
- Summary: Provides Pythagorean Theory results
- Parameters: Numeric length of non-hypotenuse sides of right triangle.
- Returns: Length of hypotenuse. Visit 3D Distance Calculator to see this function in action.
- nearest(a, b)
- Summary: Rounds
a
to nearest multiple ofb
- Parameters: a: number to round. b: multiple to round to
- Returns: number.