Skip to content

Instantly share code, notes, and snippets.

View dabit3's full-sized avatar
🎡
probably nothing

Nader Dabit dabit3

🎡
probably nothing
View GitHub Profile
@dabit3
dabit3 / ai-prompt.md
Last active April 13, 2025 23:17
Verifiable AI Inference AVS prompt using OpenAI Using WAVS - https://docs.wavs.xyz/overview

Create an OpenAI inference component based on the ETH Price Oracle (components/eth-price-oracle). The component should:

  1. Accept input in the format 'PROMPT|OPENAI_API_KEY|SEED' from a Makefile parameter
  2. Use fetch_json and http_request_post_json for API communication
  3. Return and log only choices[0].message.content and choices[0].finish_reason
  4. Include proper input validation and SEED should be an integer
  5. Use the main makefile, do not create a separate one.

Important Implementation Details:

@dabit3
dabit3 / wavs-prompting.md
Last active April 11, 2025 21:05
Prompting a WAVS price oracle AVS for a sports score oracle AVS - https://docs.wavs.xyz/overview

I want to create a similar oracle to the ETH Price Oracle at components/eth-price-oracle, but I want it to use the SportRadar API.

I want to set and reference the SportRadar API key from the Makefile, I do not want to use an .env file..

The request parameters for calling the SportRadar API look like this:

curl --request GET \
     --url 'https://api.sportradar.com/ncaamb/trial/v8/en/games/fa15684d-0966-46e7-a3f8-f1d378692109/boxscore.json?api_key={insert-api-key} \
     --header 'accept: application/json'
@dabit3
dabit3 / eigen-mcp.ts
Created March 19, 2025 22:20
EigenLayer MCP Server Example
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { z } from "zod";
import 'dotenv/config'
const server = new McpServer({
name: "EigenLayer AVS service",
version: "1.0.0",
});
@dabit3
dabit3 / generateTemplate.ts
Last active December 27, 2024 13:45
Generate a random template
const baseInstructions = `
You do not like NFTs, so don't talk about them. Never use the word Buidl.
You are a hyper-optimist while also being a skeptic.
Everything always lowercase unless it absolutely has to be for the sake of emphasis or similar.
Never use emojis.
@dabit3
dabit3 / demoday.md
Last active March 21, 2025 17:33
How to Give a Killer Pitch or Hackathon Demo
@dabit3
dabit3 / page.tsx
Created April 4, 2024 14:08
Next.js + Capsule example
'use client'
import Capsule, {
Environment,
CapsuleModal,
} from '@usecapsule/react-sdk';
import { useState, useEffect } from 'react'
const capsule = new Capsule(
Environment.BETA,
@dabit3
dabit3 / page.tsx
Created December 1, 2023 22:28
Fal + Next.js Real Time with Websockets
'use client'
import { useState } from 'react'
import { Input } from '@/components/ui/input'
import * as fal from "@fal-ai/serverless-client";
import { Excalidraw, exportToBlob } from "@excalidraw/excalidraw";
import Image from 'next/image'
fal.config({
proxyUrl: "/api/fal/proxy",
})
@dabit3
dabit3 / react-native-walletconnectmodal.js
Last active October 6, 2023 03:02
React Native WalletConnectModal Example
/*
* Resources
* Medium: https://medium.com/walletconnect/how-to-build-a-react-native-dapp-with-walletconnect-28f08f332ed7
* YouTube: https://www.youtube.com/watch?v=mGtEPQfqMV8
* Docs: https://docs.walletconnect.com/2.0/advanced/walletconnectmodal/about?platform=react-native
*/
import { WalletConnectModal, useWalletConnectModal } from "@walletconnect/modal-react-native"
import { StyleSheet, Text, View, TouchableHighlight } from "react-native"
const projectId = 'my-project-id' // see https://cloud.walletconnect.com/
@dabit3
dabit3 / app.ts
Last active July 3, 2023 23:14
AI Functions Frontend
'use client'
import { useState } from 'react'
export default function Home() {
const [input, setInput] = useState('')
const [image, setImage] = useState('')
const [audio, setAudio] = useState('')
const [text, setText] = useState('')
const [loading, setLoading] = useState(false)
async function callApi() {
@dabit3
dabit3 / ai-functions.ts
Last active July 3, 2023 23:04
Base example of GPT functions in TypeScript
import { NextRequest, NextResponse } from 'next/server'
import Replicate from 'replicate'
const replicate = new Replicate({
auth: process.env.REPLICATE_TOKEN || ''
})
const KEY = process.env.OPENAI_API_KEY || ''
const base_uri = 'https://api.openai.com/v1/chat/completions'