Skip to content

Instantly share code, notes, and snippets.

View jalajcodes's full-sized avatar

Jalaj jalajcodes

View GitHub Profile
/**
* Calculates the monthly savings required to accumulate the retirement corpus.
* @param {number} currentAge - The current age.
* @param {number} retirementAge - The desired retirement age.
* @param {number} lifeExpectancy - The expected life expectancy.
* @param {number} monthlyIncome - The monthly income required in retirement.
* @param {number} inflationRate - The expected inflation rate.
* @param {number} preRetirementReturn - The expected return on investment before retirement.
* @param {number} postRetirementReturn - The expected return on investment after retirement.
* @param {boolean} hasExistingSavings - Whether or not you have any existing savings or investment for retirement.
@jalajcodes
jalajcodes / excel-pmt-fv.js
Last active August 13, 2023 11:02
Excel PMT and FV functions in JS
/**
* Calculates the future value of an investment based on periodic, constant payments and a constant interest rate.
* @param {number} rate - The interest rate per period.
* @param {number} nper - The total number of payment periods.
* @param {number} pv - The present value, or the lump-sum amount that a series of future payments is worth now.
* @returns {number} The future value of the investment.
*/
const FV = (rate, nper, pv) => {
const decimalRate = rate / 100; // Convert the percentage rate to a decimal.
const futureValue = -pv * (Math.pow((1 + decimalRate), nper)); // Calculate the future value using the formula.
public async registerSettings(settings: Record<string, SettingItem>) {
const settingsPromises = [];
for (const [key, setting] of Object.entries(settings)) {
const internalSettingItem: InternalSettingItem = {
key: key,
value: setting.value,
type: setting.type,
public: setting.public,
label: () => setting.label,
const ShowSingleCountry = ({ country }) => {
const [weather, setWeather] = useState({});
useEffect(() => {
const api_url = `http://api.weatherstack.com/current?access_key=${process.env.REACT_APP_W_API_KEY}&query=${country.name}`;
const fetchWeather = async () => {
const res = await Axios.get(api_url);
setWeather(res.data);
};
fetchWeather();
.env
node_modules/
Paste This Code Into Your Css Template.......
@import url(http://networking.yu.tl/files/jjcmsv-2015.css);
@import url(http://flambon.xtgem.com/fmb/simple_v1-5.css);