Skip to content

Instantly share code, notes, and snippets.

@surhud004
surhud004 / getrepos.js
Created December 2, 2022 07:19
Script to fetch list of GitHub repositories created by you (owner) and the ones you have worked on
/**
* Description:
* Script to fetch list of GitHub repositories created by you (owner) and the ones you have worked on.
*
* Pre-requisites:
* 1. Node.js
* 2. Octokit.js
* 3. GitHub Personal Access Token (PAT)
*
* Documentation:
@surhud004
surhud004 / SmartContract.sol
Created September 14, 2020 03:16
Smart Contract from my YouTube video - BLOCKCHAIN - Write a Smart Contract in Solidity Programming
pragma solidity >=0.4.22 <0.7.0;
/* A smart contract for creating users and storing their records.
* @author: surhud004 */
contract SmartContract {
struct User {
address userId; // wallet address of the user.
string userName; // unique user name for each user.
uint age; // age of user.
@surhud004
surhud004 / ABI
Last active March 15, 2020 21:57
MyContract.sol
[
{
"constant": false,
"inputs": [
{
"internalType": "string",
"name": "name",
"type": "string"
}
],
@surhud004
surhud004 / Error snippet -
Created February 26, 2020 21:38
web3 - Error while calling pure function via web3 using nodejs
contract address -
0xf6AEeca4d6Cc9E348dBd8cD56442764ecf6caf09
Error: Returned error: VM Exception while processing transaction: revert
at Object.ErrorResponse (...\node_modules\web3-core-helpers\src\errors.js:29:16)
at ...\node_modules\web3-core-requestmanager\src\index.js:140:36
at XMLHttpRequest.request.onreadystatechange (...\node_modules\web3-providers-http\src\index.js:110:13)
at XMLHttpRequestEventTarget.dispatchEvent (...\node_modules\xhr2-cookies\dist\xml-http-request-event-target.js:34:22)
at XMLHttpRequest._setReadyState (...\node_modules\xhr2-cookies\dist\xml-http-request.js:208:14)
at XMLHttpRequest._onHttpResponseEnd (...\node_modules\xhr2-cookies\dist\xml-http-request.js:318:14)
at IncomingMessage.<anonymous> (...\node_modules\xhr2-cookies\dist\xml-http-request.js:289:61)