Skip to content

Instantly share code, notes, and snippets.

View ivankahl's full-sized avatar
🤪
"Maybe if I close and open it again it'll build..."

Ivan Kahl ivankahl

🤪
"Maybe if I close and open it again it'll build..."
View GitHub Profile
@ivankahl
ivankahl / Initials in 140bytes (annotated).js
Last active May 14, 2018 17:55
This function returns the initials of a name which is passed to it.
function(fn)
{
var n=fn.split(" "), // Split the full name into an array
it="", // Create and set the intials variable to nothing
i; // Set i to 0 for the while loop
while(i<n.length) // While loop that runs while i is smaller than the length of the array of names
{
it+=n[i][0]; // Get the first letter from the name and add it to the it(initial) variable
i++ // Increment i by 1
}
@pies
pies / ExcelFormulas.js
Created November 29, 2012 04:55
Few Excel formulas - PMT, PPMT, XIRR - expressed in Javascript
/* Based on
* - EGM Mathematical Finance class by Enrique Garcia M. <egarcia@egm.co>
* - A Guide to the PMT, FV, IPMT and PPMT Functions by Kevin (aka MWVisa1)
*/
var ExcelFormulas = {
PVIF: function(rate, nper) {
return Math.pow(1 + rate, nper);
},