Skip to content

Instantly share code, notes, and snippets.

View siexp's full-sized avatar
💭
Do right things and do things right.

siexp siexp

💭
Do right things and do things right.
View GitHub Profile
@siexp
siexp / api_pooling_better.js
Created February 27, 2025 12:39
useEffect & api pooling
import { useState, useEffect } from 'react';
const usePolling = (url, interval = 5000) => {
const [data, setData] = useState(null);
const [isFetching, setIsFetching] = useState(true);
useEffect(() => {
let isMounted = true;
let timerId;
@siexp
siexp / lib.rs
Created April 29, 2024 17:18
RUST + SOLANA FOR BEGINNERS
use borsh::{BorshSerialize, BorshDeserialize};
use solana_program::{
account_info::{next_account_info, AccountInfo},
entrypoint,
msg,
entrypoint::ProgramResult,
program_error::ProgramError,
pubkey::Pubkey,
};
@siexp
siexp / lib.rs
Last active April 29, 2024 16:45
Solana basic program and test
use borsh::{BorshSerialize, BorshDeserialize};
use solana_program::{
account_info::{next_account_info, AccountInfo},
entrypoint,
msg,
entrypoint::ProgramResult,
program_error::ProgramError,
pubkey::Pubkey,
};
const express = require('express');
const app = express();
const port = 3000;
app.get('/v1/health', (req, res) => {
res.send('Hello, Clockwise software!');
});
app.listen(port, () => {
console.log(`Server running on http://localhost:${port}`);