Skip to content

Instantly share code, notes, and snippets.

Avatar

Stanisław Drozd drozdziak1

View GitHub Profile
View main.rs
fn jack_sanity<F>() -> Result<AsyncClient<(), ClosureProcessHandler<F>>, Error>
where
F: 'static + Send + FnMut(&Client, &ProcessScope) -> Control,
{
let (client, _status) = Client::new("anal", ClientOptions::NO_START_SERVER)?;
let in_1 = client.register_port("in_1", AudioIn::default())?;
let in_2 = client.register_port("in_2", AudioIn::default())?;
let process_callback = move |_client: &Client, ps: &jack::ProcessScope| -> Control {
View main.rs
#[macro_use]
extern crate log;
// To import all needed traits.
use gio::prelude::*;
use gtk::prelude::*;
use std::env;
fn main() {
View merge_sort.rs
pub fn merge_no_sentinel<T: Clone + Ord>(
a: &mut [T],
p: usize,
q: usize,
r: usize,
) -> Result<(), Error> {
if !(p <= q && q <= r && r < a.len()) {
return Err(PQROutOfBounds(p, q, r).into());
}
View keybase.md

Keybase proof

I hereby claim:

  • I am drozdziak1 on github.
  • I am drozdziak1 (https://keybase.io/drozdziak1) on keybase.
  • I have a public key ASApvByX9eS8qXmBhrYqNRd_IAQEDufo_vM9VQIAFXU5mwo

To claim this, I am signing this object:

View main.rs
#[macro_use]
extern crate serde;
#[macro_use]
extern crate serde_derive;
extern crate toml;
fn default_email_subject() -> String {
String::from("Althea Exit verification code")
View kick.ck
SinOsc osc => dac;
0.3 => osc.gain;
250 => int start_freq;
20 => int end_freq;
Step s => blackhole;
0.0 => s.next;
View test.ck
for(0 => int i; i < 10000; ++i) {
SinOsc s => dac;
0.001 => s.gain;
Std.rand2f(30.0, 1000.0) => s.freq;
100::ms => now;
}
<<<"Freqs done.">>>;
View gist:9e1bc958c41ec8e97f77953035698cd6
#[derive(Clone,Debug, PartialEq)]
pub struct OscMessage {
pub addr: String,
pub args: Option<Vec<OscType>>,
}
View gist:585cf7fc2b2aa53251a21ac228b6cdc3
error: expected `,`
--> src/main.rs:95:47
|
95 | OscPacket::Message(OscMessage { addr: "/pong".to_owned(), args: None, }) => info!("JMM ping OK"),
| ^^^^^^^
error[E0027]: pattern does not mention fields `addr`, `args`
--> src/main.rs:95:28
|
95 | OscPacket::Message(OscMessage { addr: "/pong".to_owned(), args: None, }) => info!("JMM ping OK"),
View main.rs
#[macro_use]
extern crate failure;
#[macro_use]
extern crate log;
extern crate env_logger;
extern crate rosc;
extern crate rustyline;
use failure::Error;