git checkout --orphan gh-pages
git reset --hard
git commit --allow-empty -m "Initializing gh-pages branch"
git push origin gh-pages
git checkout main
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//#![no_std] | |
use serde::{Deserialize, Serialize}; | |
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone, Copy)] | |
pub enum State { | |
State1, | |
State2, | |
State3, | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::{ | |
collections::{HashMap, VecDeque}, | |
sync::{Arc, RwLock, Weak}, | |
}; | |
use uuid::Uuid; | |
#[derive(Default)] | |
pub struct Broker<T: Clone> { | |
subscribers: Arc<RwLock<HashMap<String, Vec<Weak<RwLock<Client<T>>>>>>>, | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// [dependencies] | |
// bincode = "1.3.3" | |
// serde = { version = "1.0.197", features = ["derive"] } | |
// snap = "1.1.1" | |
use bincode::{deserialize, serialize}; | |
use serde::{de::DeserializeOwned, Serialize}; | |
use snap::{read::FrameDecoder, write::FrameEncoder}; | |
use std::{ | |
fs::{File, OpenOptions}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[package] | |
name = "snapper" | |
version = "0.1.0" | |
edition = "2021" | |
[dependencies] | |
fake = "2.5" | |
snap = "1.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[package] | |
name = "app" | |
version = "0.1.0" | |
edition = "2021" | |
[dependencies] | |
egui = "0.27.2" | |
egui-wgpu = { version = "0.27.2", features = ["winit"] } | |
egui-winit = "0.27.2" | |
pollster = "0.3.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// [dependencies] | |
// anyhow = "1.0.40" | |
// env_logger = "0.11.1" | |
// winit = "0.29.10" | |
fn main() -> anyhow::Result<()> { | |
env_logger::init(); | |
let event_loop = winit::event_loop::EventLoop::new()?; | |
let _window = winit::window::WindowBuilder::new() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// [dependencies] | |
// anyhow = "1.0.40" | |
// env_logger = "0.11.1" | |
// winit = "0.28.7" | |
use anyhow::Result; | |
fn main() -> Result<()> { | |
env_logger::init(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::f32::consts::PI; | |
// Complex number struct | |
#[derive(Clone, Copy)] | |
struct Complex { | |
re: f32, | |
im: f32, | |
} | |
// Implementing basic operations for Complex numbers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// cosine based palette, 4 vec3 params | |
vec3 palette( in float t ) | |
{ | |
vec3 a = vec3(0.5, 0.1, 0.1); | |
vec3 b = vec3(0.7, 0.4, 0.4); | |
vec3 c = vec3(1.0, 0.8, 0.8); | |
vec3 d = vec3(0.263, 0.416, 0.557); | |
return a + b*cos( 6.28318*(c*t+d) ); | |
} |
NewerOlder