Skip to content

Instantly share code, notes, and snippets.

View ethereumdegen's full-sized avatar

Ethereumdegen ethereumdegen

View GitHub Profile
@ethereumdegen
ethereumdegen / custom_material.rs
Created February 19, 2024 21:19
Bevy 0.12 example for an animated material shader
use bevy::prelude::*;
use bevy::reflect::{TypePath, TypeUuid};
use bevy::render::render_resource::*;
use bevy::pbr::MaterialExtension;
<svg width="290" height="500" viewBox="0 0 290 500" xmlns="http://www.w3.org/2000/svg" xmlns:xlink='http://www.w3.org/1999/xlink'><defs><filter id="f1"><feImage result="p0" xlink:href="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0nMjkwJyBoZWlnaHQ9JzUwMCcgdmlld0JveD0nMCAwIDI5MCA1MDAnIHhtbG5zPSdodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2Zyc+PHJlY3Qgd2lkdGg9JzI5MHB4JyBoZWlnaHQ9JzUwMHB4JyBmaWxsPScjODM4NDNmJy8+PC9zdmc+"/><feImage result="p1" xlink:href="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0nMjkwJyBoZWlnaHQ9JzUwMCcgdmlld0JveD0nMCAwIDI5MCA1MDAnIHhtbG5zPSdodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2Zyc+PGNpcmNsZSBjeD0nMTknIGN5PScyNzEnIHI9JzEyMHB4JyBmaWxsPScjYzAyYWFhJy8+PC9zdmc+"/><feImage result="p2" xlink:href="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0nMjkwJyBoZWlnaHQ9JzUwMCcgdmlld0JveD0nMCAwIDI5MCA1MDAnIHhtbG5zPSdodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2Zyc+PGNpcmNsZSBjeD0nMTA0JyBjeT0nNDYyJyByPScxMjBweCcgZmlsbD0nIzkwMjJkOScvPjwvc3ZnPg==" /><feImage result="p3" xlink:href="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0nMjkwJyBoZWlnaHQ9JzUwMCcgdmlld0
@ethereumdegen
ethereumdegen / main.rs
Created June 11, 2023 15:42
A websocket server + client implementation
use std::sync::Arc ;
use tokio::sync::{Mutex,RwLock};
mod websocket_messages;
use websocket_messages::{
SocketMessage,
SocketMessageDestination,
InboundMessage,
OutboundMessage
@ethereumdegen
ethereumdegen / Api-controller.rs
Last active June 3, 2023 23:40
Actix webserver wrapper (controllers)
use actix_web::{web, HttpRequest, HttpResponse, Responder};
use std::future::{Future};
use std::pin::Pin;
use futures::future::BoxFuture;
use std::sync::Arc;
use crate::lib::web_server::{WebServerResources};
@ethereumdegen
ethereumdegen / websocket-client.ts
Last active April 29, 2023 22:07
A singleton websocket server and client implementation with app-wide pub and sub
/*
Websocket Client
let connect = await connectSocketClient( beamServerUrl )
@ethereumdegen
ethereumdegen / DappFunctionsForm.jsx
Created April 28, 2023 02:37
React Component for Smart Contract ABI Interface
import React, { useState } from 'react';
import Modal from '../utils/Modal';
import {useOutletContext} from 'react-router-dom'
import {ethers} from 'ethers'
import FunctionSection from '@/views/components/FunctionSection.jsx'
@ethereumdegen
ethereumdegen / modal.jsx
Created March 27, 2023 01:52
react tailwind modal
import { useState } from 'react';
import { observer } from "mobx-react";
function Modal({isOpen, closeModal, title, children}) {
return (
<>
@ethereumdegen
ethereumdegen / autoform.jsx
Created March 27, 2023 01:51
react-tailwind-autoform
import { useState } from 'react';
import { observer } from "mobx-react";
function AutoForm({ architecture, onSubmit }) {
const [formData, setFormData] = useState({});
const handleChange = (event) => {
setFormData({
...formData,
@ethereumdegen
ethereumdegen / Etherdelta.sol
Last active March 26, 2023 17:04
Etherdelta ERC20 Exchange
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface Token {
function transferFrom(address from, address to, uint256 value) external returns (bool);
function transfer(address to, uint256 value) external returns (bool);
}
/**
*Submitted for verification at Etherscan.io on 2021-09-17
*/
pragma solidity ^0.8.0;
/**
NFT BlockStore