Skip to content

Instantly share code, notes, and snippets.

/**
* Cumulative Interest
* (SQL Server)
* AzsaturnDx (2022) - No copyright at all
*
* Returns the cumulative interest paid on a loan between @start and @end periods.
*
* @Rate FLOAT - Required. The interest rate.
* @Periods INT - Required. The total number of payment periods.
* @Value INT - Required. The present value.
@alkampfergit
alkampfergit / WingetUpgrade.ps1
Last active November 25, 2024 17:46
Upgrade with Winget being able to select list of software to skip
class Software {
[string]$Name
[string]$Id
[string]$Version
[string]$AvailableVersion
}
$upgradeResult = winget upgrade | Out-String
$lines = $upgradeResult.Split([Environment]::NewLine)
@AndrewSouthpaw
AndrewSouthpaw / calendarCopy.js
Last active January 22, 2026 19:41
Google Apps script to copy personal events and block those times in your work calendar.
// *******************
// Contributors:
// - Andrew Smith (@AndrewSouthpaw)
// - Shaun Mosley (@Shaunm44)
// *******************
// This setup will allow you to synchronize personal events from one calendar (the "secondary calendar")
// to another calendar, e.g. work (the "primary calendar"), but obfuscate the details. Then your coworkers
// know when you're busy but don't get to see the personal details.
//
@kepano
kepano / obsidian-web-clipper.js
Last active March 3, 2026 23:21
Obsidian Web Clipper Bookmarklet to save articles and pages from the web (for Safari, Chrome, Firefox, and mobile browsers)
javascript: Promise.all([import('https://unpkg.com/turndown@6.0.0?module'), import('https://unpkg.com/@tehshrike/readability@0.2.0'), ]).then(async ([{
default: Turndown
}, {
default: Readability
}]) => {
/* Optional vault name */
const vault = "";
/* Optional folder name such as "Clippings/" */
@Azsaturndx
Azsaturndx / PPMT.sql
Created February 18, 2020 23:49
PPMT Function (Principal Payment) - SQL Server
/**
* Principal Payment
* (SQL Server)
* AzsaturnDx (2020) - No copyright at all
*
* Returns the payment on the principal for a given period for an investment based on periodic, constant payments and a constant interest rate.
*
* @Rate FLOAT - Required. The interest rate per period.
* @Period INT - Required. Specifies the period and must be in the range 1 to nper.
* @Periods INT - Required. The total number of payment periods in an annuity.
@Azsaturndx
Azsaturndx / EFFECT.sql
Created February 18, 2020 23:37
EFFECT Function (Effective Annual Interest Rate) - SQL Server
/**
* Effective Annual Interest Rate
* (SQL Server)
* AzsaturnDx (2020) - No copyright at all
*
* Returns the effective annual interest rate, given the nominal annual interest rate and the number of compounding periods per year.
*
* @Rate FLOAT - Required. The nominal interest rate.
* @Periods INT - Required. The number of compounding periods per year.
* @return FLOAT Effective Annual Interest Rate.
@Azsaturndx
Azsaturndx / financial-functions.md
Last active April 19, 2024 16:31
Financial functions (SQL SERVER)
@Azsaturndx
Azsaturndx / IPMT.sql
Last active June 1, 2022 13:46
IPMT Function (Interest payment) - SQL Server
/**
* Interest Payment
* (SQL Server)
* AzsaturnDx (2020) - No copyright at all
*
* Returns the interest payment for a given period for an investment based on periodic, constant payments and a constant interest rate.
*
* @Rate FLOAT - Required. The interest rate per period.
* @Period INT - Required. Specifies the period and must be in the range 1 to nper.
* @Periods INT - Required. The total number of payment periods in an annuity.
@Azsaturndx
Azsaturndx / FV.sql
Last active June 1, 2022 13:46
FV Function (Future value) - SQL Server
/**
* Future Value (FV)
* (SQL Server)
* AzsaturnDx (2020) - No copyright at all
*
* Calculates the future value of an investment based on a constant interest rate. You can use FV with either periodic, constant payments, or a single lump sum payment.
*
* @Rate FLOAT - Required. The interest rate for the loan.
* @Periods INT - Required. The total number of payments for the loan.
* @Payment FLOAT - Required. The payment made each period; it cannot change over the life of the annuity.
@Azsaturndx
Azsaturndx / PMT.sql
Last active June 5, 2025 17:49
PMT Function (Payment) - SQL Server
/**
* Payment (PMT)
* (SQL Server)
* AzsaturnDx (2020) - No copyright at all
*
* Calculates the payment for a loan based on constant payments and a constant interest rate.
*
* @Rate FLOAT - Required. The interest rate for the loan.
* @Periods INT - Required. The total number of payments for the loan.
* @Present FLOAT - Required. The present value, or the total amount that a series of future payments is worth now; also known as the principal.