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
# # Beat tracking example | |
import multiprocessing | |
import librosa | |
import xml.etree.ElementTree as ET | |
def get_beat_times(file_path): | |
# 2. Load the audio as a waveform `y` | |
# Store the sampling rate as `sr` | |
y, sr = librosa.load(file_path) |
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
-- Read the docs: https://www.lunarvim.org/docs/configuration | |
-- Example configs: https://github.com/LunarVim/starter.lvim | |
-- Video Tutorials: https://www.youtube.com/watch?v=sFA9kX-Ud_c&list=PLhoH5vyxr6QqGu0i7tt_XoVK9v-KvZ3m6 | |
-- Forum: https://www.reddit.com/r/lunarvim/ | |
-- Discord: https://discord.com/invite/Xb9B4Ny | |
-- Enable powershell as your default shell | |
vim.opt.shell = "pwsh.exe" | |
vim.opt.shellcmdflag = | |
"-NoLogo -NoProfile -ExecutionPolicy RemoteSigned -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.Encoding]::UTF8;" |
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
// xdg_direnv.go | |
// Package xdg is a minimal implementation of the XDG specification. | |
// | |
// https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html | |
package xdg | |
import ( | |
"path/filepath" | |
) |
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
#[derive(Debug, Clone)] | |
pub struct BufferRequestBody(pub Bytes); | |
// we must implement `FromRequest` (and not `FromRequestParts`) to consume the body | |
#[async_trait] | |
impl<S> FromRequest<S> for BufferRequestBody | |
where | |
S: Send + Sync, | |
{ | |
type Rejection = Response<Body>; |
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 once_cell::sync::Lazy; | |
use crate::{ instrument, debug, Error, events::WebhookEvent }; | |
use surrealdb::engine::remote::ws::{Ws, Client}; | |
use surrealdb::opt::auth::Root; | |
use surrealdb::sql::Thing; | |
use surrealdb::Surreal; | |
const DB_ADDRESS: &'static str = "ws://127.0.0.1:8000"; |
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
// https://github.com/open-telemetry/opentelemetry-rust/blob/main/opentelemetry-otlp/examples/basic-otlp/src/main.rs | |
const LOGS_ENDPOINT: &str = "http://localhost:55680"; | |
const COLLECTOR_ENDPOINT: &str = "http://localhost:4317"; | |
const METRICS_ENDPOINT: &str = "http://localhost:4317"; | |
// use env_logger::Logger; | |
// use log::logger; | |
// use color_eyre::eyre::Error; | |
use opentelemetry::global::{GlobalLoggerProvider, GlobalTracerProvider, GlobalMeterProvider}; |
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
mod telemetry; | |
use tracing::{ info, instrument, Level }; | |
use telemetry::initialize; | |
// use tracing_subscriber::prelude::*; | |
#[instrument] | |
fn one() { | |
println!("one") | |
} | |
#[tokio::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
[package] | |
name = "simple_ti" | |
version = "0.1.0" | |
edition = "2021" | |
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | |
[[bin]] | |
name = "simple_ti" | |
path = "src/client.rs" |
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
#![allow(unused)] | |
use std::collections::HashMap; | |
use std::collections::VecDeque; | |
use std::thread::JoinHandle; | |
use tokio::sync::Mutex; use std::sync::Arc; | |
type MessageQueue = VecDeque<Message>; | |
type MailboxMap = HashMap<String, MessageQueue>; |