I had some trace logs that I only wanted to enable conditionally, eg only when the logging level was set to TRACE. I couldn’t find a node.js library that enables this kind of logging. For each of them, the logger always evaluated the string input. The longRunningTask was always ran, even if trace logging was […]
This is for “@uiw/react-codemirror”: “^4.20.2” capture the ref to the codemirror objects 2. on each new ref callback, call the dispatch with the new selection and scrollIntoView note: I used MUI accordion, and for that the useRef didn’t seem to update when I collapsed and expanded the Accordion. Therefore I needed to update the object […]
I have recently tried my luck with code4rena, where you can earn extra income by finding bugs in Solidity contracts. At first I didn’t find any bugs, only low priority QA issues. However, after a few audits I have improved my process and submitted some critical issues. My process Read the contest details Understand the […]
What is a Knowledge Token?
Knowledge Token is an NFT project that allows content writers to create tokens that readers mint in order to see secret content. Knowledge Tokens are NFT-s stored on the Polygon blockchain. Owning a token can reveal a secret URL, which can push readers toward minting. The secret URL could be the accompanying source code for […]
How to use web3-react
Tutorial about how to use web3-react and hardhat to read and execute Solidity contracts.
ethers-multicall actually uses MakerDAO multicall contracts for multicall functionality. On a local chain this contract is not deployed, therefore the request fails with To fix this issue, the MakerDAO-s multicall contract needs to be deployed on the local node. Copy the Multicall.sol contract to your local project. The contract is available in MakerDAO repository Add […]
I have created a simple yarn workspace with a single package. This package is the default CRA Typescript app. Repository code is on Github. In this repo: Jest works in command line (yarn workspace frontend test) Jest doesn’t work when clicking the button in vscode or on startup. Tests fail with: I can fix the […]
This can be done with AWS Glue and IAM roles. Let’s assume we are transferring from account A to account B. Define a role in A to add B as trusted entity to read from DynamoDB. Create the role for AWS account, Another AWS account, and use the account B id. Result is similar to […]
Location data reduction in Android
Android LocationManager allows fine location data updates with customisable interval. This means the phone could return new coordinates even after every 100ms. If the app would then upload all of these points, it would result in expensive data and battery usage. Can this location data be reduced before sending it to the server? Problem Android […]