Skip to content

Instantly share code, notes, and snippets.

View devlongs's full-sized avatar

devlongs devlongs

View GitHub Profile

ChainVoice: Invoice Financing Platform - MVP Spec

Problem & Solution

Problem: SMBs wait 30-90 days for invoice payments, creating cash flow gaps.

Solution: Upload invoice → AI scores credit → Oracle verifies → Get cash in minutes. Investors earn 10-15% APY from real business payments.

Market: $3+ trillion in unpaid invoices globally.

@devlongs
devlongs / hyperfine.md
Created December 16, 2025 06:04
If you want to benchmark your entire compiled program (not just functions), use the hyperfine command-line tool

Install

cargo install hyperfine

Benchmark your program

hyperfine './target/release/my_program'
@devlongs
devlongs / main.rs
Last active December 16, 2025 05:57
Simple Manual Timing (Good for Quick Tests) Benchmarking
// A simple manual timing for benchmarking
use std::time::Instant;
fn main() {
let start = Instant::now();
// Code to benchmark
let result = expensive_function();
export const fromHexString = (inp: Buffer | string): Buffer => {
if (typeof inp === 'string') {
if (inp.startsWith('0x')) {
return Buffer.from(inp.slice(2), 'hex')
}
return Buffer.from(inp, 'hex')
}
// If inp is already a Buffer, just return it
return inp
@devlongs
devlongs / public_key_cryptography.go
Created September 18, 2024 11:28
This code generates private keys, public keys, public addresses, signing messages and verifyinig signatures
package crypto
import (
"crypto/ed25519"
"crypto/rand"
"encoding/hex"
"errors"
"io"
)
package main
import (
"crypto/ecdsa"
"fmt"
"log"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/common"
)
@devlongs
devlongs / keccak256_hashing.go
Last active September 14, 2024 17:54
Keccahk256 hashing in Go using the golang.org/x/crypto/sha3 library
package main
import (
"fmt"
"golang.org/x/crypto/sha3"
)
func main() {
data := "Hello, Ethereum!"
@devlongs
devlongs / hashing.go
Created September 14, 2024 17:28
Hashing in Go using the crypto/sha256 library
package main
import (
"crypto/sha256"
"fmt"
)
func main() {
hash := sha256.New()
hash.Write([]byte("Hello, World!"))
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.4;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol";
contract Erc20Token is ERC20("fire on", "FIO") {
constructor() {
_mint(address(this), 10000e18);
}
//SPDX-License-Identifier: GPL-3.0;
pragma solidity 0.8.7;
contract Energy {
//have total supply
//transferrable
//name
//symbol
//decimal