Skip to content

Instantly share code, notes, and snippets.

View imthatcarlos's full-sized avatar

Carlos Beltran imthatcarlos

View GitHub Profile
@imthatcarlos
imthatcarlos / useRedeemPoints.ts
Last active January 9, 2024 23:54
React hook for MadFi onchain points + redemption (see: https://docs.madfi.xyz/protocol-overview/onchain-points-and-redemption)
import { useState, useEffect } from 'react';
import { TransactionReceipt } from 'viem';
import { useAccount, useWalletClient } from 'wagmi';
import { getPublicClient } from '@wagmi/core';
import request, { gql } from 'graphql-request';
const CHAIN_ID = 137;
const MADFI_SUBGRAPH_URL = "https://api.thegraph.com/subgraphs/name/mad-finance/madfi-subgraph";
const SBT_REDEMPTION_CONTRACT_ADDRESS = ""; // see: https://docs.madfi.xyz
const SBT_REDEMPTION_ABI = [

Keybase proof

I hereby claim:

  • I am imthatcarlos on github.
  • I am carlosbeltran (https://keybase.io/carlosbeltran) on keybase.
  • I have a public key ASAEPJTX94Mw-v7cth-70RtxLWZZ80klKW_RmQhsPYaeoQo

To claim this, I am signing this object:

did:3:bafyreieyl74z64huwcdnpqhfvegzye4qczj3fenwncyepnn4eszdiouvxa
@imthatcarlos
imthatcarlos / production.log
Created February 2, 2017 01:44
spotify client failing - RestClient::Unauthorized (401 Unauthorized)
2017-02-02T01:36:31.954966+00:00 app[web.1]: F, [2017-02-02T01:36:31.954612 #21] FATAL -- : [367f4ad9-fbeb-4892-81ad-a76c9c7987c5]
2017-02-02T01:36:31.954981+00:00 app[web.1]: F, [2017-02-02T01:36:31.954720 #21] FATAL -- : [367f4ad9-fbeb-4892-81ad-a76c9c7987c5] RestClient::Unauthorized (401 Unauthorized):
2017-02-02T01:36:31.954982+00:00 app[web.1]: F, [2017-02-02T01:36:31.954759 #21] FATAL -- : [367f4ad9-fbeb-4892-81ad-a76c9c7987c5]
2017-02-02T01:36:31.954982+00:00 app[web.1]: F, [2017-02-02T01:36:31.954795 #21] FATAL -- : [367f4ad9-fbeb-4892-81ad-a76c9c7987c5] lib/apis/spotify_client.rb:5:in `top_tracks'
2017-02-02T01:36:31.954983+00:00 app[web.1]: [367f4ad9-fbeb-4892-81ad-a76c9c7987c5] app/bot/postback.rb:122:in `onboard_listen_song'
2017-02-02T01:36:31.954984+00:00 app[web.1]: [367f4ad9-fbeb-4892-81ad-a76c9c7987c5] app/bot/postback.rb:18:in `process'
2017-02-02T01:36:31.954985+00:00 app[web.1]: [367f4ad9-fbeb-4892-81ad-a76c9c7987c5] app/bot/brain.rb:67:in `process_postback'
2017-02-02T01:36:31.95498
@imthatcarlos
imthatcarlos / instructions.txt
Created December 4, 2016 05:04
Create a new rails application with a specific version
# make directory for new rails app
mkdir app
cd app
# specify ruby version
echo 2.3.1 > .ruby-version
# initialize bundler (creates Gemfile)
bundler init