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
/* Completa com zeros numeros com 1 digito */ | |
function pad(s) { | |
return (s < 10) ? '0' + s : s; | |
} | |
/* Obter a hora e aplica ao objeto */ | |
function newData() { | |
var date = new Date(); |
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
git rm -r --cached FolderName | |
git commit -m "Removed folder from repository" | |
git push origin master |
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
Make it cross-platform by using cross-env: | |
"server": "cross-env SERVERPORT=3002 node ./fiboserver" | |
Linux | |
"scripts": { | |
"dev:linux": "NODE_ENV=development node foo.js" | |
} |
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
"scripts": { | |
"test": "export NODE_ENV=test && jest", | |
"test:window": "set NODE_ENV=test && jest", | |
"clear_jest": "jest --clearCache", | |
"test-watch": "export NODE_ENV=test && jest --watch" | |
} |
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
// Get the duration between January 15, 1929 and April 4, 1968. | |
intervalToDuration({ | |
start: new Date(1929, 0, 15, 12, 0, 0), | |
end: new Date(1968, 3, 4, 19, 5, 0) | |
}) | |
// => { years: 39, months: 2, days: 20, hours: 7, minutes: 5, seconds: 0 } |
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
import { intervalToDuration } from 'date-fns' | |
const seconds = 10000 | |
intervalToDuration({ start: 0, end: seconds * 1000 }) | |
// { hours: 2, minutes: 46, seconds: 40 } |
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
on: [push] | |
jobs: | |
merge_conflict_job: | |
runs-on: ubuntu-latest | |
name: Find merge conflicts | |
steps: | |
# Checkout the source code so we have some files to look at. | |
- uses: actions/checkout@v2 | |
# Run the actual merge conflict finder |
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
- [] learn smart contracts | |
- [] learn Types of Blockchain | |
- [] learn eth | |
- [] learn DEFI | |
- [] learn Dapps | |
- [] learn Tokens |
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
/** | |
* @type import('hardhat/config').HardhatUserConfig | |
*/ | |
module.exports = { | |
solidity: "0.8.7", | |
paths: { | |
artifacts: './src/artifacts', | |
}, | |
networks: { |
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
// Look up the current block number | |
await provider.getBlockNumber() | |
// 14135476 | |
// Get the balance of an account (by address or ENS name, if supported by network) | |
balance = await provider.getBalance("ethers.eth") | |
// { BigNumber: "82826475815887608" } | |
// Often you need to format the output to something more user-friendly, | |
// such as in ether (instead of wei) |
OlderNewer