Skip to content

Instantly share code, notes, and snippets.

View HunderlineK's full-sized avatar
💭
😺

H HunderlineK

💭
😺
View GitHub Profile
@HunderlineK
HunderlineK / sortCommit
Created May 7, 2018 20:11
sort git commits by date
git for-each-ref --sort=committerdate refs/heads/ --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))'
const paymentFactor = 0.0068;
const duration = 180;
const f = ((p, n) => x =>
Math.pow(1 + x, n + 1) - (1 + p) * Math.pow(1 + x, n) + p)(
paymentFactor,
duration
);
const derivative = ((p, n) => x =>
@HunderlineK
HunderlineK / fixedLoan.js
Created April 17, 2018 13:29
Loan with fixed payments
const math = require('mathjs');
const last = require('lodash/last');
const range = (n) => new Array(n).fill(0);
const duration = 238;
const monthlyRate = 0.0549 / 12;
const amount = 40020 * Math.pow(1 + monthlyRate, 2);
const coefMatrix = math.matrix(