Skip to content

Instantly share code, notes, and snippets.

View ChaituVR's full-sized avatar
💙
Working from home

Chaitanya ChaituVR

💙
Working from home
View GitHub Profile
@ChaituVR
ChaituVR / change-table-collate.ts
Created June 3, 2024 09:51
change-table-collate.ts
// usuage: ts-node quick/collate-tables-issue/change-table-collate.ts <table-name>
import db from '../../utils/prodMysql';
const tableName = process.argv[2];
if (!tableName) {
console.error('Please provide a table name');
process.exit(1);
}
@ChaituVR
ChaituVR / snapshot-vote-with-node.ts
Created April 24, 2024 17:13
Snapshot vote with nodejs
import { Wallet } from "@ethersproject/wallet";
import { JsonRpcProvider } from "@ethersproject/providers";
import snapshot from "@snapshot-labs/snapshot.js";
const mnemonic = "announce room limb pattern dry unit scale effort smooth jazz weasel alcohol"
let wallet = Wallet.fromMnemonic(mnemonic)
const provider = new JsonRpcProvider("https://rpc.ankr.com/eth");
wallet = wallet.connect(provider)
console.log(wallet.address)
@ChaituVR
ChaituVR / test.md
Created October 16, 2021 04:53
Ankr Arbitrum Node

Request

curl 'https://apis.ankr.com/e9536947ec5942a9930f724f42226975/6106d4a3ec1d1bcc87ec72158f8fd089/arbitrum/full/main' \
  -H 'Connection: keep-alive' \
  -H 'Cache-Control: max-age=0' \
  -H 'sec-ch-ua: "Chromium";v="94", "Google Chrome";v="94", ";Not A Brand";v="99"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36' \
  -H 'content-type: application/json' \
@ChaituVR
ChaituVR / uni.md
Created October 13, 2021 06:55
UNI SPACE
  • Proposal #/uniswap/proposal/QmcpJ8Qm9V4LfK5ncpPvGpCEkzt2uV9jahueX2CR9YLGVv CACHE: image WITHOUT CACHE: Same as CACHE

  • Proposal #/uniswap/proposal/QmcpJ8Qm9V4LfK5ncpPvGpCEkzt2uV9jahueX2CR9YLGVv CACHE: image

@ChaituVR
ChaituVR / README.txt
Created September 29, 2021 06:18
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
REMIX EXAMPLE PROJECT
Remix example project is present when Remix loads very first time or there are no files existing in the File Explorer.
It contains 3 directories:
1. 'contracts': Holds three contracts with different complexity level, denoted with number prefix in file name.
2. 'scripts': Holds two scripts to deploy a contract. It is explained below.
3. 'tests': Contains one test file for 'Ballot' contract with unit tests in Solidity.
SCRIPTS
This file has been truncated, but you can view the full file.
curl 'https://api-geth-archive.ankr.com/' \
-H 'Connection: keep-alive' \
-H 'Cache-Control: max-age=0' \
-H 'sec-ch-ua: "Google Chrome";v="93", " Not;A Brand";v="99", "Chromium";v="93"' \
-H 'Authorization: Basic YmFsYW5jZXJfdXNlcjpiYWxhbmNlckFua3IyMDIwMTAxNQ==' \
-H 'content-type: application/json' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'Origin: http://localhost:3000' \
-H 'Sec-Fetch-Site: cross-site' \
-H 'Sec-Fetch-Mode: cors' \
@ChaituVR
ChaituVR / Instructions.md
Last active June 3, 2020 11:55
Instructions

chartjs-to-image

Instructions to Deploy Script as a AWS Lambda function:

Create a Lambda Function:

  • Login to AWS Console and go to https://console.aws.amazon.com/lambda/home
  • Select Region and click "Create Function" button
  • Select "Auther from Scratch" and Give your function a name (ex: convert-chartjs-to-image)
@ChaituVR
ChaituVR / gist:a382919df6a8152d06d90a757f5864bd
Last active March 1, 2019 19:06
GraphJS-server Installation
## Update to PHP-7
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.2 php7.2-common php7.2-simplexml php7.2-mbstring php-bcmath
sudo a2dismod php5
sudo a2enmod php7.2
sudo service apache2 restart
php -v
## Install Bcmath extension
@ChaituVR
ChaituVR / Change.txt
Last active September 13, 2017 05:41
1) Open this file: app/design/frontend/rwd/default/template/configurableswatches/catalog/product/view/type/configurable/swatch-js.phtml
2) Change this:
<script type="text/javascript">
document.observe('dom:loaded', function() {
var swatchesConfig = new Product.ConfigurableSwatches(spConfig);
});
</script>
To this: