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
@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 July 22, 2024 10:30
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
anonymous
anonymous / bonfire-validate-us-telephone-numbers.js
Created December 4, 2015 17:28
http://www.freecodecamp.com/harshitanand 's solution for Bonfire: Validate US Telephone Numbers
// Bonfire: Validate US Telephone Numbers
// Author: @harshitanand
// Challenge: http://www.freecodecamp.com/challenges/bonfire-validate-us-telephone-numbers
// Learn to Code at Free Code Camp (www.freecodecamp.com)
function telephoneCheck(str) {
// Good luck!
var re = /^(?:(?:\+?1\s*(?:[.-]\s*)?)?(?:\(\s*([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9])\s*\)|([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9]))\s*(?:[.-]\s*)?)?([2-9]1[02-9]|[2-9][02-9]1|[2-9][02-9]{2})\s*(?:[.-]\s*)?([0-9]{4})$/;
return re.test(str);