Skip to content

Instantly share code, notes, and snippets.

View microchipgnu's full-sized avatar
🖼️
µ

Luís Freitas microchipgnu

🖼️
µ
View GitHub Profile
const Arweave = require("arweave");
const { bundleAndSignData, createData, ArweaveSigner } = require("arbundles");
const fs = require("fs");
const jwk = JSON.parse(fs.readFileSync("./jwk.json", { encoding: "utf8" }));
const arweave = Arweave.init({
host: "arweave.net", //arweave.dev
port: 443,
protocol: "https",
@microchipgnu
microchipgnu / diff.md
Last active September 15, 2021 16:05
Metadata diff

NEAR_ENV=mainnet near view pluminite.near nft_tokens "{\"from_index\":\"0\",\"limit\":\"10\"}"

NEAR_ENV=mainnet near view x.paras.near nft_tokens "{\"from_index\":\"0\",\"limit\":10}"

NEAR_ENV=mainnet near view uhhmnft.near nft_tokens "{\"from_index\":\"0\",\"limit\":10}"

Pluminite

How to interact with Mintbase contracts from your DAO

This tutorial assumes you are using Sputnik DAO v2 (https://v2.sputnik.fund/)

1. Create a "Custom Function" proposal

{
"name": "asdasd"
}
const allowCors = (fn) => async (req, res) => {
res.setHeader("Access-Control-Allow-Credentials", true)
res.setHeader("Access-Control-Allow-Origin", "*")
res.setHeader(
"Access-Control-Allow-Methods",
"GET,OPTIONS,PATCH,DELETE,POST,PUT"
)
res.setHeader(
"Access-Control-Allow-Headers",
@microchipgnu
microchipgnu / postgres_utils.md
Last active November 13, 2020 17:09
postgres utils

How to drop a PostgreSQL database if there are active connections to it?

-- first
SELECT pg_terminate_backend(pg_stat_activity.pid) 
FROM pg_stat_activity 
WHERE pg_stat_activity.datname = 'DATABASE_NAME' 
  AND pid <> pg_backend_pid();

-- second 
ganache-cli --fork https://mainnet.infura.io/v3/{infura_project_id}@{block_number}

Keybase proof

I hereby claim:

  • I am microchipgnu on github.
  • I am luisfreitas (https://keybase.io/luisfreitas) on keybase.
  • I have a public key whose fingerprint is 1108 1B94 013F 91AA FFBE 8DB4 E7DC 955E C591 9D2E

To claim this, I am signing this object:

This post links my 3Box profile to my Github account! Web3 social profiles by 3Box.
✅ did:3:bafyreifperjwrmmwd557te5nipfgjg4yqkdlubccfaor5hcvfjoxv2ouya ✅
Create your profile today to start building social connection and trust online at https://3Box.io/
🌞 Morning 221 commits ██▍░░░░░░░░░░░░░░░░░░ 11.9%
🌆 Daytime 689 commits ███████▊░░░░░░░░░░░░░ 37.1%
🌃 Evening 638 commits ███████▏░░░░░░░░░░░░░ 34.3%
🌙 Night 310 commits ███▌░░░░░░░░░░░░░░░░░ 16.7%