Skip to content

Instantly share code, notes, and snippets.

View rollendxavier's full-sized avatar

Rollend Xavier rollendxavier

View GitHub Profile
@rollendxavier
rollendxavier / style.css
Created March 30, 2025 02:40
Create a file named style.css in static/css/ with this content to give your interface a dark, modern look:
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');
body {
font-family: 'Roboto', sans-serif;
background-color: #1e1e2f;
color: #ffffff;
margin: 0;
padding: 0;
display: flex;
justify-content: center;
@rollendxavier
rollendxavier / index.html
Created March 30, 2025 02:38
Create a file named index.html in the templates folder with this content:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="AI chatbot interface with dark theme">
<title>AI Chatbot</title>
<link rel="icon" href="/favicon.ico" type="image/x-icon">
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/style.css') }}">
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
@rollendxavier
rollendxavier / app.py
Last active March 30, 2025 02:48
How to Build Your Own Crypto AI Agent (Python Guide)
import nltk
from nltk.chat.util import Chat, reflections
import requests
from flask import Flask, render_template, request, jsonify
from sklearn.linear_model import LinearRegression
import numpy as np
import os
from dotenv import load_dotenv
app = Flask(__name__)
@rollendxavier
rollendxavier / main.f
Created January 2, 2025 04:16
Provisioning Azure Resources with Terraform
provider "azurerm" {
features {}
subscription_id = "YOUR_AZ_SUBSCRIPTION_ID"
}
terraform {
backend "azurerm" {
resource_group_name = "rg-realtime-crypto-alerts"
storage_account_name = "stgrealtimecryptoalerts"
@rollendxavier
rollendxavier / Function.cs
Last active January 2, 2025 04:36
Leveraging CoinGecko API with Azure Functions for Serverless Crypto Solutions
using System;
using System.IO;
using System.Net.Http;
using System.Threading.Tasks;
using System.Net;
using System.Net.Mail;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.Http;
using Microsoft.AspNetCore.Http;
@rollendxavier
rollendxavier / Index.js
Created November 13, 2024 11:16
Node.js program integrating Web3.js, the CoinGecko API
const https = require('https');
const Web3 = require('web3');
const axios = require('axios');
require('dotenv').config();
const fs = require('fs');
const express = require('express');
// Load environment variables
const COINGECKO_API_KEY = process.env.COINGECKO_API_KEY;
@rollendxavier
rollendxavier / MyToken.sol
Created November 13, 2024 11:14
Solidity Contract File
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract MyToken {
    string public name = "MyToken";
    string public symbol = "MTK";
    uint8 public decimals = 18;
    uint256 public totalSupply = 1000000 * 10 ** uint256(decimals);
    mapping(address => uint256) public balanceOf;
@rollendxavier
rollendxavier / truffle-config.js
Created November 13, 2024 11:09
Configuring Truffle for Deployment
const HDWalletProvider = require("@truffle/hdwallet-provider");
const infuraKey = "YOUR_INFURA_KEY";
const mnemonic = "your 12-word mnemonic";
module.exports = {
networks: {
rinkeby: {
provider: () => new HDWalletProvider(mnemonic, `https://rinkeby.infura.io/v3/${infuraKey}`),
network_id: 4, // Rinkeby ID
gas: 5500000,
@rollendxavier
rollendxavier / route.ts
Last active May 10, 2024 07:47
Trending pools code
import { FrameRequest, getFrameMessage, getFrameHtmlResponse } from '@coinbase/onchainkit';
import { NextRequest, NextResponse } from 'next/server';
import { NEXT_PUBLIC_URL } from '../../config';
import { getChartOptions } from '../lib/getChartOptions';
import { throwErr } from '../lib/throwErr';
async function getResponse(req: NextRequest): Promise<NextResponse> {
let text: string | undefined = '';
let pool: any | undefined = {};
let chain: string = '';
@rollendxavier
rollendxavier / page.tsx
Last active May 8, 2024 23:04
Page code for Farcaster
import { getFrameMetadata } from '@coinbase/onchainkit';
import type { Metadata } from 'next';
import { NEXT_PUBLIC_URL } from './config';
const frameMetadata = getFrameMetadata({
buttons: [
{
label: 'Trending Crypto Pools',
},
{