Skip to content

Instantly share code, notes, and snippets.

View nully0x's full-sized avatar
🎯
Building

nully0x nully0x

🎯
Building
View GitHub Profile
@nully0x
nully0x / chat-btc.md
Created November 6, 2023 14:47
chat-btc payment flow revisit

Current Model

  • User makes a prompt, after 5 prompt, L402 kicks and request for payment to avoid based on user preference.
  • On payment successful, prompts can go through.

Issue

  • L402 keeps prompting the user to make payment which disrupt user experience
  • L402 kicks every 10min time elapsed which trigger new payment processs

Rethinking the approach

  • An alby user can set budget and we can track the session such that after 10 min the user does not get prompt and interrupt his reading (similar to likes on bolt.fun)
  • What about non alby users?
  • Separate or remove L402 from invoice generation or have another approach to implement rate limiting.
@nully0x
nully0x / warnet-api.md
Last active October 25, 2023 17:40
Implementing user interaction with Warnet

Task

Unify the client and server api

Refactor the api endpoints to just three:

  • Account creation
  • Signin Action (to return api key for authorisation)
  • Json-Rpc method call (authenticatied request).

Flow

@nully0x
nully0x / 136-k6.sh
Created August 15, 2023 07:08 — forked from vfarcic/136-k6.sh
# Source: https://gist.github.com/fda147804b59fd2a0cbb5fb5deb4d00b
##################################################################
# The Best Performance And Load Testing Tool? k6 By Grafana Labs #
# https://youtu.be/wfanR-Ps-lk #
##################################################################
# Additional Info:
# - k6: https://k6.io
# - Google Cloud Run (GCR) vs Azure Container Instances (ACI) vs AWS ECS with Fargate: https://youtu.be/Jq8MY1ZGjno
@nully0x
nully0x / tweet-classifier.py
Last active July 28, 2022 13:58
Making of tweet classifier helper functions
#I had just fetch a lot of tweets regarding a subject matter and after cleaning it left over fourteen thousand unique tweets. If you ask me that is quite huge but not too hug I guess.
#These clean extract is to be subject to sentiment analysis to get more information and know to what intent they convey there views.
#Here is the problem
#A sentence/message(tweet) could have a percieved meaning it conveys but choice of words, emojis and emoticons could be make it more elaborate.
#So the task before subjecting to NLP model prepared were:
#Task 1
#Step 1: Identify the Emotion words in the tweets and place them in a new column..
@nully0x
nully0x / MyNFT.sol
Created June 3, 2021 09:22 — forked from oliverjumpertz/MyNFT.sol
A basic ERC721 (NFT) implementation. Instantly runnable in remix.ethereum.org
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.9.0;
import "https://raw.githubusercontent.com/OpenZeppelin/openzeppelin-contracts/master/contracts/token/ERC721/ERC721.sol";
import "https://raw.githubusercontent.com/OpenZeppelin/openzeppelin-contracts/master/contracts/utils/Counters.sol";
import "https://raw.githubusercontent.com/OpenZeppelin/openzeppelin-contracts/master/contracts/access/AccessControl.sol";
import "https://raw.githubusercontent.com/OpenZeppelin/openzeppelin-contracts/master/contracts/utils/Context.sol";
contract MyNFT is Context, AccessControl, ERC721 {
@nully0x
nully0x / esm-package.md
Created May 9, 2021 22:33 — forked from sindresorhus/esm-package.md
Pure ESM package

Pure ESM package

The package linked to from here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@nully0x
nully0x / Getting_Started_with_Fuel_in_NodeJS.js
Created May 2, 2020 23:35 — forked from SilentCicero/Getting_Started_with_Fuel_in_NodeJS.js
The NodeJS example code from the recent Fuel tutorial blog post.
const { Wallet, utils, dbs } = require("fuel-core");
(async () => {
// DB and Key Setup
const db = new dbs.Level(); // persisting db
const privateKey = (await db.get('key')) || utils.randomBytes(32);
await db.put('key', privateKey);