promisify

Create a function to turn any function into a "promisfied" function. Any function to be promisified will always have a callback as the last argument.…

DOM Manipulation with Vanilla JS

Not every app or webpage needs to be done in React, Vue or the latest framework. Sometimes, you just need plain old HTML, CSS and JavaScript to get the job done. Here's a handy guide for DOM manipulation with Vanilla JS.…

modifier in solidity

modifier is used to declare some code that will be re-used throughout the contract. Write once, use everywhere. For example, instead of doing the require check on owner, declare this modifier: modifier onlyOwner { require(msg.sender == owner, "Only contract owner can do this"); _; // run the function } and can…

assert in solidity

assert is used to check the contract's code for errors and make sure code runs like it's supposed to. Usually by testing certain invariants (an invariant is a condition that should always be true at a certain stage in the code). These are the cases when…