Skip to content

Instantly share code, notes, and snippets.

View harshitanand's full-sized avatar
🏠
Working from home

Harshit Anand harshitanand

🏠
Working from home
  • Bangalore, India
View GitHub Profile
@hackinf0
hackinf0 / Connecting Multiple Database in NodeJs with MongoDB and Mongoose
Last active September 4, 2024 17:38
Connecting Multiple Database in NodeJs with MongoDB and Mongoose
Explanation file: db.js
This code imports the mongoose library which allows to connect to a MongoDB database.
There are two URIs defined to connect to two different databases: MONGO_URI and MOBILE_URI.
Each URI contains connection information to a remote MongoDB database, including user credentials.
The connectDBs function uses the mongoose.createConnection method to create connections to these two
databases using the respective URIs. The useUnifiedTopology and useNewUrlParser options are set to enable the new
unified topology policy and use MongoDB's new URL parser, respectively.
The function returns an object that contains the connections to these two databases as qrCodeDb and userDB properties.
@harshitanand
harshitanand / safe_sig_gen_uport_eip712.ts
Created April 22, 2022 13:03 — forked from rmeissner/safe_sig_gen_uport_eip712.ts
Example Safe signature generation with uport eip712 lib
import EIP712Domain from "eth-typed-data";
import BigNumber from "bignumber.js";
import * as ethUtil from 'ethereumjs-util';
import { ethers } from "ethers";
import axios from "axios";
/*
* Safe relay service example
* * * * * * * * * * * * * * * * * * * */

An guide how to activate Windows 11 Pro for free

Why?

Because you will get some more features like an Bitlocker and host your device as an External Desktop which can be accessed through the internet

Am i also able to switch from any other edition to Pro?

The answer is yes! You can switch from almost any edition to Pro completely for free!

Note for users with unactivated Pro edition

People which already have Pro, but not activated, can skip to this step.

Getting started

What you first need to do is open CMD (Command Prompt) as Administrator using this keyboard key:

```sql
CREATE USER 'login'@'localhost' IDENTIFIED BY 'pass';
GRANT SELECT,UPDATE,INSERT ON dbname.* TO 'login'@'localhost';
GRANT ALL PRIVILEGES ON dbname.* TO 'login'@'localhost';
FLUSH PRIVILEGES;
```
Если: An exception occurred in driver: SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client
То: ALTER USER 'zabbix_yurchenko'@'localhost' IDENTIFIED WITH mysql_native_password BY 'zabbix_yurchenko';
@leoGalani
leoGalani / config.py
Last active February 10, 2023 15:25
kafka-confluent-python implementation example
import certifi
from dynaconf import settings
from confluent_kafka.avro import AvroProducer
from confluent_kafka import Consumer
BASE_CONFIG = {
'bootstrap.servers': settings.KAFKA_PRIMARY_BOOTSTRAP_SERVERS,
'group.id': 'integrated-tests',
'client.id': 'integrated-tests',
@bradtraversy
bradtraversy / vscode_shortcuts.md
Last active September 14, 2024 16:50
Helpful shortcuts for VSCode

VSCode Shortcuts

List of helpful shortcuts for faster coding

If you have any other helpful shortcuts, feel free to add in the comments of this gist :)

Official List of all commands

@dwelch2344
dwelch2344 / kafka-consumer.test.js
Created October 2, 2018 20:05
kafka avro nodejs example
const registryUrl = 'http://schema-registry:8081'
const avro = require('avsc')
const registry = require('avro-schema-registry')(registryUrl)
const kafka = require('kafka-node')
const client = new kafka.KafkaClient({ kafkaHost: 'kafka:9092' })
const topic = {
topic: 'actor7',
offset: 3695
@chrisvfritz
chrisvfritz / extensions.md
Last active January 25, 2023 18:40
VSCode Config
  • Annotator: Display the annotation view (git blame) of the current file.
  • beutify: Beautify javascript, JSON, CSS, Sass, and HTML in Visual Studio Code.
  • Can I Use: Compatibility check for HTML5, CSS3, SVG, New JS API based on http://caniuse.com/ directly from Visual Studio Code.
  • Code SpellChecker: A basic spell checker that works well with camelCase code.
  • Custom CSS and JS: Custom CSS to your VS Code.
  • Debugger for Chrome: A VS Code extension to debug your JavaScript code in the Google Chrome browser, or other targets that support the Chrome Debugging Protocol.
  • EditorConfig for VSCode: EditorConfig support for Visual Studio Code.
  • ESLint: Integrates ESLint into VS Code.
  • File Utils: A convenient way of creating, duplicating, moving, renaming, deleting files and directories.
  • Flow Language Support: This extension adds Flow support for VS Code. Flow is a static type checker, designed to find type errors in JavaScript programs.
@harshitanand
harshitanand / Realtime Calculator.markdown
Created February 29, 2016 08:36
Realtime Calculator