Skip to content

Instantly share code, notes, and snippets.

View anupam-io's full-sized avatar
🤠
bonjour

anupam anupam-io

🤠
bonjour
View GitHub Profile
@anupam-io
anupam-io / main.py
Created February 27, 2021 10:44
Voice logging function in Python using gTTS
def vlog(s):
s = str(s)
from gtts import gTTS
from os import system
language = 'en'
output = gTTS(text=s, lang=language, slow=False)
system("mkdir -p .vlogs")
output.save("./.vlogs/output.mp3")
system("ffplay -nodisp -autoexit ./.vlogs/output.mp3 >/dev/null 2>&1")
@anupam-io
anupam-io / tensorflow-on-chars74k.ipynb
Last active April 11, 2021 13:51
Tensorflow-on-chars74K.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@anupam-io
anupam-io / IT.js
Last active April 4, 2021 16:36
Mimicking `mocha`'s it utitlity.
const assert = require("assert");
async function it(name, fun) {
await fun()
.then(() => {
console.log(name, ": passed.");
})
.catch((err) => {
console.log(name, ": failed.");
console.log("Error: ", err);
@anupam-io
anupam-io / main.js
Created April 5, 2021 19:25
Encrypting & Decrypting data with web3 on ETH
data = "";
privateKey = "";
rpcEndpoint = "";
password = "";
const Web3 = require("web3");
const provider = new Web3.providers.HttpProvider(rpcEndpoint);
const web3 = new Web3(provider);
async function main() {
@anupam-io
anupam-io / main.js
Created April 5, 2021 19:43
Wallets in web3 on ETH
rpcEndpoint = "YOUR-RPC-URL";
password = "PASSWORD";
const Web3 = require("web3");
const provider = new Web3.providers.HttpProvider(rpcEndpoint);
const web3 = new Web3(provider);
const assert = require("assert");
async function main() {
// Creating a wallet
@anupam-io
anupam-io / main.js
Created April 11, 2021 06:10
Loading ABI dynamically from contract address
rpcEndpoint = `...`;
addressURL = `...`;
const axios = require("axios");
const Web3 = require("web3");
var web3 = new Web3(new Web3.providers.HttpProvider(rpcEndpoint));
async function main() {
url =
`http://api-kovan.etherscan.io/api?module=contract&action=getabi&address=` +
@anupam-io
anupam-io / copy-of-tensorflow-on-chars74k.ipynb
Last active April 11, 2021 23:12
Solving-captchas-with-tensorflow-on-chars74K.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@anupam-io
anupam-io / captcha-using-tensorflow-on-chars74k.ipynb
Created April 12, 2021 13:04
Captcha-using-tensorflow-on-chars74K.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@anupam-io
anupam-io / Sleep.md
Last active June 19, 2021 11:21
How to get a good night sleep?

How can I sleep 😳 ?

Follow a takeoff routine in the morning 🛫

  • 🌞 Expose yourself to natural light
  • 🪥 Brush your teeth
  • 🚰 Drink appropriate amount of water
  • 🧘‍♂️ Do mindfulness meditation
  • 🙆‍♂️ Do light workout
  • 🔈 Listen to your morning playlist or your morning podcast
@anupam-io
anupam-io / auto.py
Created May 12, 2021 05:51
Automatic compile script
from time import sleep
from os import system
it = 0
while True:
system("clear")
system("cargo run") # Change this to your compile script
it+=1
print(it, "th iteration completed.")
sleep(1)