This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import axios from 'axios'; | |
import * as mfsha2 from 'multiformats/hashes/sha2'; | |
import * as digest from 'multiformats/hashes/digest'; | |
import { CID } from 'multiformats/cid'; | |
const REGEX = 'template-ipfs://{ipfscid:(?<version>[01]):(?<codec>[a-z0-9-]+):(?<field>[a-z0-9-]+):(?<hash>[a-z0-9-]+)}'; | |
const parseCID = (url, reserveAddress) => { | |
var matches = url.match(REGEX); | |
if (!matches) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use client'; | |
import toast from 'react-hot-toast'; | |
const memes = [ | |
'/memes/meme-1.png', | |
].sort(); | |
const copyImageToClipboard = async (imageUrl: string) => { | |
try { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import random | |
from PIL import Image | |
import json | |
import csv | |
# Get the current working directory | |
current_directory = os.path.dirname(os.path.abspath(__file__)) | |
# Set the paths based on the current working directory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nfd-verify:9673764 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nfd-verify:3690058 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const rarityScore = getTraitRarityScore(nft, allNfts); | |
// https://medium.com/@nfthelperbot/understanding-nft-rarity-calculation-c724518efd63 | |
// rarityScore = 1 ÷ ([Number of Items With That Trait Value] / [Total Number of Items in Collection]) | |
function getTraitRarityScore(nft, allNfts) { | |
if (!nft?.metadata?.properties || Object.keys(nft.metadata.properties).length === 0) return 0; | |
const total = allNfts.length; | |
const traitFrequencies = getTraitFrequencies(allNfts); | |
const rarityScore = Object.entries(nft.metadata.properties).reduce((acc, [trait, value]) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const formatWordPressUrlsInString = (str: string): string => { | |
if (!str) return ''; | |
// from wizzy fields | |
const pageExp = `${process.env.NEXT_PUBLIC_WP_URL}/hoops_page`; | |
const postExp = `${process.env.NEXT_PUBLIC_WP_URL}/hoops_`; | |
const videoExp = `${process.env.NEXT_PUBLIC_WP_URL}/hoops_video`; | |
const teamExp = `${process.env.NEXT_PUBLIC_WP_URL}/hoops_team`; | |
const pageRegExp = new RegExp(pageExp, 'g'); | |
const postRegExp = new RegExp(postExp, 'g'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const frens = [ | |
{ | |
id: 544176827, | |
name: 'skuli frens #1', | |
unitname: 'sf001', | |
rank: 281, | |
arc69: { properties: { background: 'tealpink', skin: 'white', face: 'redeyes', head: 'bluedurag', body: 'redstrippedshirt' } }, | |
image: 'https://ipfs.io/ipfs/bafkreiflc5bj3zdf5oe3dn2dmtqtyrzdroozgt7bi5nnwbun6wujthniuq#i', | |
href: 'https://www.nftexplorer.app/asset/544176827', | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useEffect, useState, createContext, useContext } from 'react'; | |
import jsPDF from 'jspdf'; | |
import toast from 'react-hot-toast'; | |
import toDataUrl from '../utilities/toDataUrl'; | |
import { logEvent } from '../utilities/ga'; | |
import useStorage from './useStorage'; | |
import { STORAGE_KEYS } from '../config'; | |
const CARD_WIDTH_DEFAULT = 66; | |
const CARD_HEIGHT_DEFAULT = 92; |
NewerOlder