Nov 18, 2021
Create a bootable USB stick with Mac to install Debian
Nov 15, 2021
Jasmine in Angular Unit-test: Modify a Read-only value with "Object.definedProperty"
If you are using Typescript and when you're not as well-versed with it (like I do), then surely you'll come into type issue from time to time.
If unlucky, eslint will also give you some headache time during your development work too, but that's good sign that you are learning.
Problems
Modifying a read-only value in Angular Unit-Test (*.spec.ts) files will give you warning like below:
Cannot assign a value to a read-only property even on Unit Test script |
the routerSpy is a mocked Router from '@angular/router'.
let routerSpy: jasmine.SpyObj<Router>;
Solution
With the help from native Javascript Object.defineProperty(), we can set value manually through method below:
Set value through Object.defineProperty |
Nov 2, 2021
Oh no! Now I learned my lesson, I missed the best time to cash out Banano!
Recently, Banano value jump to the peak of $0.05USD from its usual $0.009USD. And sadly, I wanted to cash out my banano and I can't because I have no idea how to do it!
Banano - From $0.009USD to $0.054USD |
I've learned my lesson, I missed the best time to cash out while keep seeing the value drop before my very eyes. So I hope this article can help someone who has the same situation as I did.
If you've follow my post earlier about Folding@Home (FAH), by now you may have learned how to earn it, or may already have some Banano in your wallet.
What's next?
Wrapping Banano into Wrapped Banano (wBan)
Steps: Banano to wBan Wrapping
Prerequisites
- BNB, Binance Coin (beginner may find this difficult. Be warned, spending a little real money, or fiat money, to make this transaction success)
- Banano coins
- A Banano wallet
- Chrome Browser
- MetaMask from Chrome Web Store
- Created wallet in your MetaMask with some BNB deposited (approx ~$2USD)
Steps
- Install MetaMask Chrome Extension
- Visit bsc.banano.cc and "connect" your wallet through MetaMask (chrome extension from 1st step)
- Follow the wallet creation step as needed in MetaMask (follow the instructions from the extension)
- Transfer your banano to wBan (make sure your sender and receiver addresses are accurate, it's always better to us QR scanner than typing it manually)
- After trasnfered, your Ban coin will show up pretty fast. Fill in amount you want to wrap into wBan.
- Before you can continue, please make sure you have a little amount of BNB in your MetaMask wallet for "gas fee" or transaction fee. (You can get it through many platform: check out the "buy" button here)
- After purchasing from a platform, first you need to transfer them to your MetaMask BNB coin wallet address. Yup, this transaction cost gas fee too.
- Back to the wBan wrapping screen you now can start wrapping. Add wBan coin to your wallet by pressing "Add wBan to MetaMask" button.
- Pressing the "wrap" button, MetaMask will prompt you to confirm the transaction.
- After the transaction is confirmed, amount of wrapped wBan will reflect on your MetaMask wallet.
- Convert/swap your wBan to different coin, where this coin must be a coin that allow you to easily cash out on different platform, for example BNB coin.
- After you swap wBan into BNB, withdraw it to BNB wallet address, usually it's where you first get and where it's transferred from on step 7.
- Now you have more BNB. You can then decide further invest it or cash out to enjoy your earning.
Oct 27, 2021
jsonwebtoken error troubleshoot: Uncaught Error: error:0909006C:PEM routines:get_name: no start line
jsonwebtoken error
Description
If you encounter error below:
Uncaught Error: error:0909006C:PEM routines:get_name:no start line
Reason
jsonwebtoken.sign(PAYLOAD, PRIVATE_KEY, OPTIONS)
the PRIVATE_KEY value above must be string, and sometimes this string can be mistakenly "JSON.stringify()". Even though the end result is still a string, but JSON.stringify encoding turns the string into JSON string format, and it's not a value we want to provide to the sign() function.
Below is example error code
//error from node_modules/jsonwebtoken/sign.js
{
library: 'PEM routines',
function: 'get_name',
reason: 'no start line',
code: 'ERR_OSSL_PEM_NO_START_LINE'
}
Aug 30, 2021
CakeDeFi - Earn passive income by staking your crypto and forget about it
Old way of earning from crypto
It's been a while having my crypto sit quietly in my crypto wallet. As an non-savvy crypto owner, mining and trading crypto is most I know about how one can earn from crypto.
Crypto Staking Experiment with Cake DeFi
"Staking" has been a new term to my early this year (of 2021). It's nowadays an easier approach to generate revenue with your available crypto without the need of hunting for expensive GPU (for mining) and additional payment monthly electricity bill.
My first staking experience was started with CakeDeFi (affiliate link)
My first experiment started 4 months ago (April 2021), I transferred 20 DFI to my partner. And then she directly put them all into "Staking" with auto-compound and she forgot about it until she received an email today.
20 DFI + staking became USD106 |
In this case:
20DFI worth approximate USD75 (4 months ago)
20DFI + staking (auto-compound) = ~USD106 (August same year)
Looking at the chart below, I picked the peak value point on April as example. Compared to the highlighted value, it has lower price today at the time of this writing (USD2.79 / DFI). The value of staking with autocompound compensated the drop in USD value, while still profit from the extra DFI token earned from staking.
USD price changes of DFI |
How does earning from staking work?
The following is an example about daily earning:
See the result for yourself first
This isn't a financial advisor post, please DO NOT read or treat it like one. I'm not any certified financial advisor, I'm just sharing my good experience with what've achieved with CakeDeFi. If you are a owner of crypto already, then you may have already know the how's its volatility affect its value, so please be warned, do it only what you think you capable of, never overdo anything. Like the old saying, never put all your eggs in one basket.
If you are interested to get an account, you can use this CakeDefi affiliate link and get extra USD$30 worth of DFI after you sign up & make your first $50 deposit.
How does it looks like inside?
Have fun staking!
Aug 17, 2021
Unit test on Angular with Jasmine, test case executed randomly
Problems
expect(modalCtrlSpy.dismiss.calls.count()).toBe(1);
The "count()" is accumulated throughout the test cases from the start until the end of a "described" scenario. If test cases get executed without following the order as written test, it fails due to "count()" result get accumulated differently across the test. It can't match the "expected" accumulated result if test run randomly.
Solution
Jul 24, 2021
Folding@Home - Contribute idle computer processing power to science research
Folding@Home
What is Folding at Home (or in shortform, fah)
It is a project that allow user to contribute their processing power during computer is in idle status. The contributed processing power will be used by fah program to help scientist finding cure for deceases, and processing power donor would get some compensation in return in crypto form (different options available too).
If you don't have any GPU, CPU alone is enough to get you started with the folding.
Kalium Wallet |
And here's the example of compensation I received so far. Meanwhile, I'm not into contributing to earn, that's not my purpose, and so shouldn't you. Otherwise, you'll be hunted by annoying inner voice which get you keep checking at the compensation figure every single day or worse every single hour.
Banano & Kalium Wallet
How to do it?
- Get an address (a long text that as your ID) from any listed wallet on https://kalium.banano.cc/ (I picked kalium)
- visit bananominer site to get started with your address.
- enter required info into https://client.foldingathome.org/ (after FAH installation is completed)
- setup a passkey that let F@H know that the contribution is from you, this will earn you more bonus (they claim so, but i haven't able to check how much more bonus you'll get with passkey attached).
Lastly, I've seen topic about getting payout in dogecoin, but I haven't manage to find any reliable guide to try with. So I think it's still best to stick with banano team, as it's been number 1 ranked team until these days at the time of this writing.
Banano Team, the number 1 FAH contributor |
https://folding.lar.systems/projects/
https://foldingathome.org/statistics/
Accessibility (a18y) - Minimum Touch Target Size (48dp)
Udacity Course: Web Accessibility
Minimum touch size for mobile screen: 48dp
Jan 14, 2021
Troubleshooting: Could not initialize class org.codehaus.groovy.reflection.ReflectionCache
And I keep getting these errors when I run “npx cap add android”:
Syncing GradleError running gradle sync Starting a Gradle Daemon, 1 stopped Daemon could not be reused, use --status for details
java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7
… #skipped verbose error messages
FAILURE: Build failed with an exception.
* What went wrong:
Could not initialize class org.codehaus.groovy.reflection.ReflectionCache
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 21s
Unable to infer default Android SDK settings. This is fine, just run npx cap open android and import and sync gradle manually
The Solution
Firstly, you'll to know which java version is your android studio is using, find the info in "About Android Studio".
Set environment variable to point JAVA_HOME to the path where openjdk version of "1.8.0_242-release” (or embedded jdk inside Android Studio app folder) located. On Mac, it's usually
/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home
MacOS (Android Studio 4.1.1):
export JAVA_HOME="/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home"
jenv User:
jenv add "/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home"
Window:
Add/update environment variable JAVA_HOME and point it to path where the correct version of openjdk extracted.