This file contains hidden or 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
| // use once for thread-safe: http://marcio.io/2015/07/singleton-pattern-in-go/ | |
| package singleton | |
| import ( | |
| "sync" | |
| ) | |
| type singleton struct { | |
| } |
This file contains hidden or 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
| // to define and start interval | |
| function ClickConnect(){ | |
| console.log("Working"); | |
| document.querySelector("#top-toolbar > colab-connect-button").shadowRoot.querySelector("#connect").click(); | |
| } | |
| // set timer for every 5 minutes | |
| var clicker = setInterval(ClickConnect,60000 * 5); | |
| clicker; | |
| // to clear interval |
This file contains hidden or 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 requests | |
| chain_ids = [1,10,56,137,250,42161,43114] | |
| nb_dexes = 0 | |
| for chain_id in chain_ids: | |
| dexes = requests.get('https://api.paraswap.io/adapters/list', params={'namesOnly': "true", 'network':chain_id}).json() | |
| print(f"Chain {chain_id}: {len(dexes)} dexes") | |
| nb_dexes += len(dexes) |