Skip to content

Instantly share code, notes, and snippets.

View itsanishjain's full-sized avatar

Anish Jain itsanishjain

View GitHub Profile
@itsanishjain
itsanishjain / page.tsx
Created February 12, 2024 10:38
Search with pagincation with Nextjs14
// utils.ts
export const generatePagination = (currentPage: number, totalPages: number) => {
// If the total number of pages is 7 or less,
// display all pages without any ellipsis.
if (totalPages <= 7) {
return Array.from({ length: totalPages }, (_, i) => i + 1);
}
// If the current page is among the first 3 pages,
@Vectorized
Vectorized / MiladyRaveMaker.sol
Last active October 21, 2023 00:38
MiladyRaveMaker
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/access/Ownable.sol";
import "erc721a/contracts/ERC721A.sol";
import "erc721a/contracts/extensions/ERC721AQueryable.sol";
import "solady/src/utils/ECDSA.sol";
import "solady/src/utils/LibString.sol";
import "solady/src/utils/SafeTransferLib.sol";