This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Calculates the remaining inventory, current average buy price, total cost and total gains using FIFO (First In First Out) method. | |
* The function expects three parameters: transactionsType, transactionQuantities and transactionPrices sorted by date. | |
* | |
* Inspired by: https://www.allstacksdeveloper.com/2022/09/fifo-stock-portfolio-google-sheets.html | |
* | |
* @param {string[] | string} transactionsType - An array or a single string representing transaction types. Each string should be either 'B' for buy or 'S' for sell. | |
* @param {number[] | number} transactionQuantities - An array or a single number representing the quantities for each transaction. | |
* @param {number[] | number} transactionPrices - An array or a single number representing the prices for each transaction. | |
* @throws Will throw an error if transactionPrices and transactionQuantities are not arrays or if their lengths are not equal. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$settings = []; | |
// svg file | |
if (isset($_GET['svg'])) { | |
// general/custom svg file | |
$svgFile = DIR_ASSETS.'/cdn/dist/svg/'.$_GET['svg']; | |
if (!preg_match('~^\w[\w/-]+\.svg$~', $_GET['svg']) || !file_exists($svgFile)) die('Invalid svg'); | |
} elseif (isset($_GET['fa'])) { | |
// fontawesome icon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Copyright 2019 Jason Hu <awaregit at gmail.com> | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software |
- Edit the file at
/Library/Backblaze.bzpkg/bzdata/bzexcluderules_editable.xml
. - Add these rules inside the
bzexclusions
tag:
<!-- Exclude node_modules. -->
<excludefname_rule plat="mac" osVers="*" ruleIsOptional="t" skipFirstCharThenStartsWith="users/" contains_1="/node_modules/" contains_2="*" doesNotContain="*" endsWith="*" hasFileExtension="*" />
<excludefname_rule plat="mac" osVers="*" ruleIsOptional="t" skipFirstCharThenStartsWith="users/" contains_1="/.git/" contains_2="*" doesNotContain="*" endsWith="*" hasFileExtension="*" />
- You've installed Xdebug in your VM.
- You've installed Xdebug extension for VSCode and reloaded/restarted VSCode.
- You have not forwarded port 9000 from the guest to the host.
- Configure Debugger in VSCode. See item 1 next.
This is a guide for aligning images.
See the full Advanced Markdown doc for more tips and tricks
FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.
- By Edmond Lau
- Highly Recommended 👍
- http://www.theeffectiveengineer.com/
NewerOlder