Skip to content

Instantly share code, notes, and snippets.

Avatar
🦀
Crab People! Crab People! Crab People!

xd009642

🦀
Crab People! Crab People! Crab People!
View GitHub Profile
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

View rfclottery.py
#
# Downloads a random RFC and saves to text file.
#
import random
import urllib.request
MAX_RFC = 8449
while True:
choice = random.randint(1, MAX_RFC)
View gist:f6e3ab160c2c1d18efba
### Keybase proof
I hereby claim:
* I am xd009642 on github.
* I am xd009642 (https://keybase.io/xd009642) on keybase.
* I have a public key whose fingerprint is E41E B6C4 DF00 0782 0DE0 A150 560F 1F28 BCFC DD24
To claim this, I am signing this object: