Skip to content

Instantly share code, notes, and snippets.

View gzkdev's full-sized avatar

Godswill Ezihe gzkdev

View GitHub Profile
@gzkdev
gzkdev / README.md
Created March 29, 2026 21:28 — forked from kettanaito/README.md
Publishing to npm in 2026

Prerequisites

  • Use Node.js v24. Trusted Publishing does not work on earlier versions of Node.js.

Steps

  1. Go to "Account > Access Tokens" and click "Generate Access Token".
  2. Give the new token "read and write" persmissions to "All packages".
  3. If you have 2FA enabled on npm (which you should), check the "Bypass 2FA" checkbox neatly hidden in the UI. Otherwise, npm will fail with an error demanding an OTP during automatic publishing.
  4. Create the token.
@gzkdev
gzkdev / ERC20.sol
Last active February 26, 2025 15:17
ERC20 Implementation
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.20;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address to, uint256 amount) external returns (bool);
function allowance(address owner, address to) external view returns (uint256);
function approve(address to, uint256 amount) external returns (bool);
function transferFrom(address from, address to, uint256 amount) external returns (bool);
@gzkdev
gzkdev / luhn_algorithm.md
Last active September 11, 2024 14:55
Luhn's Algorithm

Luhn's Algorithm

What is Luhn's Algorithm

Luhn's algorithm, also known as the "modulus 10" algorithm, is a simple checksum formula used to validate a variety of identification numbers, most notably credit card numbers. It is designed to protect against accidental errors such as mistyped digits.

How it works

  1. Double every second digit from the right.
  2. If the doubled value is greater than 9, sum the digits (e.g., 12 becomes 1 + 2 = 3).