Skip to content

Instantly share code, notes, and snippets.

Avatar

richö butts richo

View GitHub Profile
View certs.rs
fn check_signature(&self, key: &ed25519_dalek::PublicKey) -> StdResult<(), ed25519_dalek::ed25519::Error> {
let bytes = self.details_as_proto()
.expect("Couldn't serialize details");
let res = key.verify(&bytes, self.signature());
dbg!(&res);
return res
}
View lib.rs
struct Thing {
inner: Inner,
}
struct Inner {
name: Composite,
}
struct Composite {
t1: String,
View lib.rs
pub enum Thing {
Lol {
name: String,
other: u64,
},
Haha {
name: String,
whatever: i8,
}
}
View trimmer.rs
impl PathWithTransform for RemotePathDescriptor {
type Output = RemotePathDescriptor;
fn with_modification<T: AsTransform>(&self, detail: &T) -> RemotePathDescriptor {
use RemotePathDescriptor::*;
let tweak = detail.as_transform().tweak_name();
match self {
dt @ DateTime { .. } => dt.clone(),
dn @ DateName { .. } => {
let new = dn.clone();
View staging.rs
impl<T: Into<U>, U: DescriptorNameable> DescriptorNameable for T {
fn staging_name(&self) -> String {
self.into().staging_name()
}
fn manifest_name(&self) -> String {
self.into().manifest_name()
}
fn remote_path(&self) -> PathBuf {
View lib.rs
use web_sys;
use web_sys::{Request, RequestInit, RequestMode, Response, Element};
mod utils;
use wasm_bindgen::prelude::*;
use wasm_bindgen::JsCast;
use wasm_bindgen_futures::JsFuture;
use stokepile_shared::staging::StagedFile;
View mountv2.stl
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View serialize.rs
use std::io::{self, Read};
use protobuf;
use rocket::{Request, Data, Outcome::*};
use rocket::data::{FromDataSimple, Outcome, Transform, Transformed};
use rocket::http::Status;
// We have to involve a local trait for *reasons*
trait FromDataMarker {}
@richo
richo / .gitignore
Last active Feb 13, 2020
cbindgen thingy
View .gitignore
/target
**/*.rs.bk
Cargo.lock