This file contains hidden or 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
| sudo -i | |
| loadkeys br-abnt2 | |
| setfont ter-v18n | |
| ifconfig | |
| wpa_supplicant -B -i INTERFACE -c <(wpa_passphrase 'SSID' 'PASS') | |
| curl google.com |
This file contains hidden or 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 { defineConfig } from 'vite'; | |
| import react from '@vitejs/plugin-react'; | |
| import inject from '@rollup/plugin-inject'; | |
| export default defineConfig(({ mode }) => { | |
| return { | |
| plugins: [react()], | |
| build: | |
| mode === 'production' | |
| ? { |
This file contains hidden or 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
| sudo -i | |
| loadkeys br-abnt2 # Setting the keyboard layout to Brazilian ABNT2 | |
| setfont ter-v32n # Increase font | |
| curl google.com # Check internet connection | |
| parted /dev/sda -- mklabel gpt # use GPT partition table | |
| parted /dev/sda -- mkpart primary 512MiB 100% # 16GiB partition for LVM and 512MiB boot partition |
This file contains hidden or 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 api = axios.create({ | |
| baseURL: apiBaseURL, | |
| }); | |
| api.interceptors.request.use(async (config) => { | |
| if (!getToken()) await auth(); | |
| return { | |
| ...config, |
This file contains hidden or 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 type GraphQLFields<T, C> = { | |
| [K in keyof T]: Omit<GraphQLFieldConfig<T, C>, 'type' | 'resolve'> & { | |
| type: GraphQLScalarTypeConfig<T[K], T[K]>, | |
| resolve?: GraphQLFieldResolver<T, C, any, T[K]> | |
| }; | |
| }; |
This file contains hidden or 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
| { | |
| "scripts": { | |
| "build": "tsup", | |
| "dev": "yarn build --onSuccess \"yarn start\"", | |
| "dev:watch": "yarn dev --watch", | |
| "start": "node dist/index.js", | |
| }, | |
| "devDependencies": { | |
| "tsup": "^5.11.13", | |
| "typescript": "4.5.5" |
This file contains hidden or 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 web3 = require('@solana/web3.js'); | |
| const { Metadata } = require('./token-metadata/js/dist/src/mpl-token-metadata'); | |
| const connection = new web3.Connection(web3.clusterApiUrl('devnet'), 'confirmed'); | |
| const wallet = new web3.PublicKey('WALLET_PUBLIC_KEY'); | |
| console.time('findByOwnerV2'); | |
| Metadata.findByOwnerV2(connection, wallet).then(() => console.timeEnd('findByOwnerV2')); | |
| console.time('findByOwnerV3'); |
This file contains hidden or 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 web3 from '@solana/web3.js'; | |
| import base58 from 'bs58'; | |
| import { asyncFilter } from './asyncFilter'; // From https://gist.github.com/fersilva16/dea9bb85ca69de435d01b8793d44948a | |
| const TOKEN_PROGRAM_ID = new web3.PublicKey( | |
| 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA' | |
| ); | |
| const TOKEN_METADATA_PROGRAM_ID = new web3.PublicKey( |
This file contains hidden or 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 { asyncEach } from './asyncEach'; // From https://gist.github.com/fersilva16/bdf2d0b9a5eedbcf7232760df876a87d | |
| export async function asyncFilter<T>( | |
| array: { map(callback: (value: T) => any): Promise<any>[] }, | |
| predicate: (value: T) => Promise<boolean> | |
| ): Promise<T[]> { | |
| const result: T[] = []; | |
| await asyncEach(array, async (value, ...args) => { | |
| const shouldAdd = await predicate(value, ...args); |
This file contains hidden or 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 type { FileInfo, API } from 'jscodeshift'; | |
| const newPackagesMap: Record<string, string> = { | |
| '@material-ui/core': '@mui/material', | |
| '@material-ui/icons': '@mui/icons-material', | |
| '@material-ui/styles': '@mui/styles', | |
| }; | |
| const newPackages = Object.keys(newPackagesMap); |