Skip to content

Instantly share code, notes, and snippets.

@devoNOTbevo
devoNOTbevo / node_mysql_exporter.ts
Created January 4, 2023 15:31
A beginner friendly
const mysql = require('mysql');
const fs = require('graceful-fs');
// Make any queries constant for readability
const TABLES_QUERY =
"SELECT table_name FROM information_schema.tables WHERE table_schema ='my_table_schema";
const COLUMNS_QUERY = 'SELECT column_name from information_schema.columns';
// Create the MySQL connection
const connection = mysql.createConnection({
@mrinalwadhwa
mrinalwadhwa / ecdh.py
Created March 5, 2020 20:47
Elliptic Curve Diffie-Hellman key exchange from scratch
#!/usr/bin/env python3
# The below code is an attemt to understand Elliptic Curve Cryptography
# by implementing Elliptic Curve Diffie-Hellman key exchange from scratch.
# DON'T USE THIS CODE IN YOUR APP!!
# It is not safe and is intended only as a learning tool.
import secrets
@nanspro
nanspro / ens.md
Last active July 5, 2023 21:00
Create an end to end tutorial for building app on ENS

Getting started with ENS

Task Url: https://gitcoin.co/issue/ensdomains/docs/10/2816

What is ENS

ENS (Ethereum Name Service) is analogous to DNS (Domain Name System) for IP addresses, in that it maps a memorable shortcut to an address. ENS is a distributed, decentralized, open, and extensible naming system based on the Ethereum blockchain and a useful tool for developers to create more memorable names for their dapps.

An ENS name can be a subdomain of the root .eth domain, like "example.eth" or any subdomain of a subdomain, like "sub.example.eth", or "wallet.username.example.eth"

Using ENS we can map a friendly ENS name, e.g., "ethereum.eth", to an unfriendly Ethereum address, e.g., 0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359. Users can then use the friendly name instead of the address, making it easier to remember, and reducing the chance of errors.

@xirixiz
xirixiz / Set up GitHub push with SSH keys.md
Last active April 25, 2024 20:53 — forked from developius/README.md
Set up GitHub push with SSH keys

SSH keypair setup for GitHub (or GitHub/GitLab/BitBucket, etc, etc)

Create a repo.

Make sure there is at least one file in it (even just the README.md)

Generate a SSH key pair (private/public):

ssh-keygen -t rsa -C "your_email@example.com"
@darelf
darelf / base64.cpp
Last active August 28, 2023 17:44
Base64 url encode/decode. C++ adapted from some old code by someone else...
#include <string>
#include <vector>
/*
Base64 translates 24 bits into 4 ASCII characters at a time. First,
3 8-bit bytes are treated as 4 6-bit groups. Those 4 groups are
translated into ASCII characters. That is, each 6-bit number is treated
as an index into the ASCII character array.
If the final set of bits is less 8 or 16 instead of 24, traditional base64
@karpathy
karpathy / min-char-rnn.py
Last active April 26, 2024 11:55
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)