Skip to content

Instantly share code, notes, and snippets.

@mahemoff
mahemoff / README.md
Last active September 16, 2024 18:02
Vim Terminal Mode - A short introduction

Vim has a Terminal Mode!

Since v8.1 (May 2018), Vim has shipped with a built-in terminal. See https://vimhelp.org/terminal.txt.html or type :help terminal for more info.

Why use this? Mainly because it saves you jumping to a separate terminal window. You can also use Vim commands to manipulate a shell session and easily transfer clipboard content between the terminal and files you're working on.

Key Bindings

// To enable meta transaction, let create a generic method that calls executeMetaTransaction by taking the user signature
// and then execute transaction via Biconomy
// Dependencies
import {toBuffer} from "ethereumjs-util";
import abi from "ethereumjs-abi";
import events from "events";
// Initialization of web3
let web3 = new Web3(window.ethereum);
@meagtan
meagtan / galois.c
Last active August 10, 2024 00:48
Quick implementation of Galois fields
/*
* The following is an implementation of the finite field GF(2^8) as bit vectors of length 8, where the nth bit represents the
* coefficient of the nth power of the generator in each element, and the generator satisfies the minimal polynomial
* x^8 + x^4 + x ^3 + x^2 + 1 in the prime field Z_2, in which addition is equivalent to XOR and multiplication to AND.
* The elements of GF(2^8) thus represent polynomials of degree < 8 in the generator x. Addition in this field is simply
* bitwise XOR, but multiplication requires the elimination of powers of x <= 8.
*/
#include <stdio.h>
#include <stdint.h>