Skip to content

Instantly share code, notes, and snippets.

View dblodorn's full-sized avatar
🥁
Jamming @ourzora

ᦔꪖ꠸ꪀ ᥇ꪶꪮᦔꪮ᥅ꪀ ᛕ꠸ꪑ dblodorn

🥁
Jamming @ourzora
View GitHub Profile
@dblodorn
dblodorn / listIPFSDirectory.ts
Created January 25, 2024 22:47
List all the files in a nested ipfs directory running a node locally
import type { IPFSHTTPClient } from 'ipfs-http-client'
import all from 'it-all'
let ipfs: IPFSHTTPClient
async function getIpfsClient() {
if (!ipfs) {
const { create: createIpfsClient } = await import('ipfs-http-client')
ipfs = createIpfsClient({
url: `http://localhost:5001/api/v0`,
@dblodorn
dblodorn / fetchOwnedContracts.ts
Last active June 16, 2023 01:20
fetchOwnedContracts.ts
import { OwnedContractsProps } from 'modules/profiles/data/types'
import { OwnedContractsReturn } from 'modules/profiles/data/types'
import 'wagmi/server'
export interface fetchOwnedContractsResponse {
contractsData: OwnedContractsReturn[]
contractsCount: number
pageKey?: number
}
@dblodorn
dblodorn / fetchOnchainSince.ts
Created June 16, 2023 01:18
fetchOnchainSince.ts
import { Alchemy, AssetTransfersCategory } from 'alchemy-sdk'
import { ethers } from 'ethers'
import { format } from 'date-fns'
import { fetchTransaction } from 'shared/lib/wagmi-core'
import { FirstTransaction } from './types'
import 'shared/config/wagmi/server'
import { isMainnet } from 'shared/utils'
export async function fetchOnchainSince(
address: string,
@dblodorn
dblodorn / blog.ts
Created January 25, 2023 18:15
Flatten Sanity Post to Text nextjs api route example
import type { NextApiRequest, NextApiResponse } from 'next'
import {
getClient,
postQuery,
SanityPostQueryProps,
} from '../../../lib/sanity'
const blogPostHandler = async (req: NextApiRequest, res: NextApiResponse): Promise<void> => {
const { slug } = req.query
@dblodorn
dblodorn / Dropzone.tsx
Last active December 6, 2022 20:39
Big ass nft storage form
import React, { useCallback, useEffect } from 'react'
import { css } from '@emotion/react'
import { useDropzone } from 'react-dropzone'
interface DropzoneProps {
value?: any
description?: string
accepted?: string
onDrop: (acceptedFiles: File) => any
}
@dblodorn
dblodorn / .bash_profile
Created September 13, 2022 00:10
Git Aliases:
## Git Aliases
alias gs='git status -s'
alias gb='git branch'
alias gd='git diff'
alias gl='git log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --dat$
alias gco='git checkout'
alias ga='git add .'
alias gcm='git commit -m'
alias gpo='git push origin'
alias gpuo='git pull origin'

Additional Styling on top of zord:

You can set global styles and use classNames to inherit them using this pattern:

globalStyle('light-font', {
  fontWeight: 300,
  fontFamily: "'ptRegular', Arial, Helvetica, sans-serif!important",
  color: 'green'
})
magick mogrify -density 72 -resize 1600 *.jpg
const typeWriter = (el, cb) => {
const TxtType = function(config) {
this.type = config.type
this.el = config.el
this.speed = config.speed
this.txt = ''
this.i = 0
this.tick()
}
TxtType.prototype.tick = function() {
@dblodorn
dblodorn / react-next-snippets.json
Created December 5, 2017 03:32
React and Next.js Snippets for VSC
{
/*
// Place your snippets for JavaScript here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
"Print to console": {
"prefix": "log",
"body": [