Skip to content

Instantly share code, notes, and snippets.

View itsanishjain's full-sized avatar

Anish Jain itsanishjain

View GitHub Profile
@itsanishjain
itsanishjain / expressjs_zerops_settings.yml
Last active July 23, 2024 11:43
expressjs zerops settings
zerops:
- setup: mymeetingavailability
# ==== how to build your application ====
build:
# what technologies should the build
# container be based on (can be an array)
base: nodejs@20
# what commands to use to build your app
buildCommands:
import { vitePlugin as remix } from "@remix-run/dev";
import { defineConfig, type UserConfig } from "vite";
import tsconfigPaths from "vite-tsconfig-paths";
// Related: https://github.com/remix-run/remix/issues/2835#issuecomment-1144102176
// Replace the HOST env var with SHOPIFY_APP_URL so that it doesn't break the remix server. The CLI will eventually
// stop passing in HOST, so we can remove this workaround after the next major release.
if (
process.env.HOST &&
(!process.env.SHOPIFY_APP_URL ||
@itsanishjain
itsanishjain / zerops.yml
Last active June 21, 2024 18:41
zerops yml of shopify apps
zerops:
- setup: app
build:
base: nodejs@22
buildCommands:
- yarn install
- yarn run build
deployFiles:
- build
- drizzle
@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,
@itsanishjain
itsanishjain / AlcmenyWebsocket.tsx
Last active February 12, 2024 10:48
How to utilize the Alchemy WebSocket to subscribe to and monitor Ethereum transactions for users.
"use client";
import { Network, Alchemy } from "alchemy-sdk";
import { ethers } from "ethers"; // ethers V6
const settings = {
apiKey: "", // Replace with your Alchemy API Key.
network: Network.MATIC_MAINNET, // Replace with your network.
};
@itsanishjain
itsanishjain / self-hosted-hasura
Last active October 26, 2023 05:55
Setting up your Hasura Instance
server {
root /var/www/YOUR_DOMAIN_PATH_NAME/html;
index index.html index.htm index.nginx-debian.html;
server_name YOUR_DOMAIN;
location / {
proxy_pass YOUR_SERVER_IP:8080;
proxy_http_version 1.1;
@itsanishjain
itsanishjain / rarityScore.js
Last active February 14, 2023 05:04
Creates the rarity similar to Opensea
/*
- yarn init -y
- update package.json :)
{
"name": "rarity",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
// 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/Milady.sol";
import "solady/src/utils/ECDSA.sol";
import "solady/src/utils/LibString.sol";
import "solady/src/utils/SafeTransferLib.sol";