Skip to content

Instantly share code, notes, and snippets.

View vit0rr's full-sized avatar

vitor vit0rr

View GitHub Profile
@vit0rr
vit0rr / transferNft.js
Created April 8, 2022 01:01
Transfer a NFT with Solana Web3.js
// Every req.body.{} is from Postman
const nftAddress = await new web3.PublicKey(req.body.nftAddress);
const getNftATA = await spl.Token.getAssociatedTokenAddress(
spl.ASSOCIATED_TOKEN_PROGRAM_ID,
spl.TOKEN_PROGRAM_ID,
nftAddress,
mintAuthority.publicKey
);
@vit0rr
vit0rr / starterweb3.md
Last active June 10, 2024 17:15
start-web3

Que materiais recomendo para começar em web3?

O repositório web3brasil tem materil traduzido ou produzido em pt-br e em inglês. Também recomendo para começar praticando com alguns projetos do buildspace, que tem diversos passo a passo para começar com Ethereum, Solana etc, seguindo a mesma linha o Web3 University, Solana CookBook

Que techs recomendo?

Rust, JavaScript, React.js, Anchor...

Comunidades?

Você pode entrar no Discord do Fantom Kittens, Anchor, Metaplex entre outros que você pode ir achando por ai.

@vit0rr
vit0rr / Metadata.d.ts
Last active May 23, 2024 04:45
Metaplex Metadata interface
/// <reference types="node" />
/// Locale: node_modules/@metaplex-foundation/mpl-token-metadata/dist/src/accounts/Metadata.d.ts
import { Borsh, Account, AnyPublicKey, StringPublicKey } from '@metaplex-foundation/mpl-core';
import { AccountInfo, Connection, PublicKey } from '@solana/web3.js';
import { Buffer } from 'buffer';
import { Edition } from './Edition';
import { MasterEdition } from './MasterEdition';
import { Uses } from './Uses';
@vit0rr
vit0rr / clean_code.md
Created March 7, 2024 12:53 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@vit0rr
vit0rr / a.v
Created August 13, 2023 01:42
Proof in Coq that natural numbers are infinity
Theorem plus_1_n : forall n : nat, n + 1 = S n /\ S n > n.
Proof.
intros n.
split.
- induction n as [| n' IHn'].
+ simpl. reflexivity.
+ simpl. rewrite <- IHn'. reflexivity.
- induction n as [| n' IHn'].
+ simpl. apply le_n.
+ simpl. apply le_n_S. apply IHn'.

Como Pensar

Ler e entender um pouco desse artigo. https://wiki.c2.com/?FeynmanAlgorithm

  • Reconhecer como você pensa
  • Descrever métodos que você usa para pensar
  • Entender métodos diferentes de pensar
  • Fazer perguntas sobre tudo(incluindo sobre perguntas)

Perguntas

@vit0rr
vit0rr / youtube_format_code_itag_list.md
Created December 30, 2022 18:43 — forked from sidneys/youtube_format_code_itag_list.md
YouTube video stream format codes itags

YouTube video stream format codes

Comprehensive list of YouTube format code itags

itag Code Container Content Resolution Bitrate Range VR / 3D
5 flv audio/video 240p - - -
6 flv audio/video 270p - - -
17 3gp audio/video 144p - - -
18 mp4 audio/video 360p - - -
22 mp4 audio/video 720p - - -
// computing
C_bool = (A : Type) -> A -> A -> A;
(c_true : C_bool) = A => t => f => t;
(c_false : C_bool) = A => t => f => f;

// induction
I_bool b = (P : C_bool -> Type) -> P c_true -> P c_false -> P b;
i_true : I_bool c_true = P => p_t => p_f => p_t;
i_false : I_bool c_false = P => p_t => p_f => p_f;
let one = (f) => (x) => f(x) // (λf.λx.f x)
let two = (f) => (x) => f(f(x)) // (λf.λx.f (f x))
let _succ = (n) => (f) => (x) => f(n(f)(x)) // (λn.λf.λx.f (n f x))
let _add = (m) => (n) => (f) => (x) => m(f)(n(f)(x)) // (λm.λn.λf.λx.m f (n f x))
let _mult = (m) => (n) => (f) => (x) => m(n(f))(x) // (λm.λn.λf.λx.m (n f) x)
let _exp = (m) => (n) => (f) => (x) => n(m)(f)(x) // (λm.λn.λf.λx.n m f x)
let _pred = (n) => (f) => (x) => n((g) => (h) => h(g(f)))(u => x)(u => u) // (λn.λf.λx.n (λg.λh.h (g f)) (λu.x) (λu.u))
let _sub = (m) => (n) => n(_pred)(m) // (λm.λn.n pred m)
@vit0rr
vit0rr / start.md
Last active November 20, 2022 12:22
Como iniciar no Rust?

A maneira mais comum para começar a estudar Rust é ler o livro oficial da linguagem. Irá ensinar sobre vários dos conceitos mais importantes sobre a linguagem.

A leitura pode ser acompanhada por: