Skip to content

Instantly share code, notes, and snippets.

View full-sized avatar
🦀
Crab People! Crab People! Crab People!

xd009642

🦀
Crab People! Crab People! Crab People!
View GitHub Profile
View reload_layer.rs
use core::task::{Context, Poll};
use http::{Request, Response};
use std::convert::Infallible;
use std::sync::{Arc, RwLock};
use tonic::body::BoxBody;
use tonic::transport::Body;
use tower_layer::Layer;
use tower_service::Service;
pub struct ReloadLayer {
View game 3 vs Vis (snatching defeat from jaws of victory)
# move 3
If Vis plays a6 go for a4 as I don't want b5 and a big queen side attack he can lock down
d6 e6 or Qb6 I play Nc3 (I feel there's some gambit here I should know...?)
Play e4 at some point to reinforce centre
if b5 go for f3 e4 and make his light square bishop useless
View gist:ae5c18faad2dd21beb953f2e72340c8a
#[derive(Debug, Clone)]
pub struct Biquad{
/* https://ccrma.stanford.edu/~jos/fp/Direct_Form_II.html */
b0: f64,
b1: f64,
b2: f64,
a1: f64,
a2: f64,
}
View ffmpeg_streaming_server.rs
use bytes::{Buf, Bytes, BytesMut};
use opentelemetry::sdk;
use opentelemetry::sdk::propagation::TraceContextPropagator;
use opentelemetry::sdk::trace::{Builder, Sampler};
use opentelemetry::trace::TracerProvider;
use opentelemetry::{global::set_text_map_propagator, KeyValue};
use std::convert::TryFrom;
use std::env::var;
use std::net::SocketAddr;
use std::process::Stdio;
View audio_load.lua
function read_file(path)
local file, errorMessage = io.open(path, "r")
if not file then
error("Could not read the file:" .. errorMessage .. "\n")
end
local content = file:read "*all"
file:close()
return content
end
local FileBody = read_file("audio.wav")
View hough.rs
pub struct HoughParameters<T, D, F>
where
D: Dimension,
F: Sized + (Fn(f64) -> Array1<T>),
{
/// Represents the dimensionality of the hough space
pub dim: PhantomData<D>,
/// Parameter bounds
pub bounds: Array2<T>,
/// Search resolution for each parameter. Should be the same size as bounds.
View gist:55a9ceca5d5741991cf524e31db136b8
module cordic
(
input clk,
input ce,
input rst,
input signed [18-1:0] x_in,
input signed [18-1:0] y_in,
input [18-1:0] phase_in,
View generated_cordic.v
module cordic
(
input clk,
input ce,
input rst,
input signed [18-1:0] x_in,
input signed [18-1:0] y_in,
input [18-1:0] phase_in,
View Cobertura 04 DTD
<!-- Portions (C) International Organization for Standardization 1986:
Permission to copy in any form is granted for use with
conforming SGML systems and applications as defined in
ISO 8879, provided this notice is included in all copies.
-->
<!ELEMENT coverage (sources?,packages)>
<!ATTLIST coverage line-rate CDATA #REQUIRED>
<!ATTLIST coverage branch-rate CDATA #REQUIRED>
<!ATTLIST coverage lines-covered CDATA #REQUIRED>
View Rust 2019.md

Rust 2019

This is a bit of a brain dump of my thoughts about Rust 2019. Mainly I work on my own code coverage tool tarpaulin, embedded rust and random little tools. So my perspective will be coloured by this.

Stabilising proc-macro

So this year tarpaulin found itself needing to be compiled on nightly. This was because syntex-syntax is no longer maintained, and as a result, new syntax was