This file contains hidden or 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
| /* | |
| add to Cargo.toml (if missing): | |
| [dependencies] | |
| foreign-types-shared = "0.1.1" | |
| openssl = "0.10.75" | |
| openssl-sys = "0.9.111" | |
| Test with e.g.: | |
| $ openssl req -new -x509 -key root.key -out root.pem -days 365 -subj "/CN=Test" -config openssl.cnf -extensions add_key_usage |
This file contains hidden or 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 std::time::Duration; | |
| trait UpdateSource: Send { | |
| fn info(&self) -> String; | |
| } | |
| struct OnlineUpdate { | |
| version: String, | |
| url: String, | |
| } |
This file contains hidden or 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 std::time::Duration; | |
| use futures::StreamExt; | |
| #[tokio::main] | |
| async fn main() -> Result<(), reqwest::Error> { | |
| let args: Vec<_> = std::env::args().collect(); | |
| let url = &args[1]; | |
| let target_rate = args.get(2).map(|a| a.parse::<f64>().unwrap()); |
This file contains hidden or 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
| #!/usr/bin/env python3 | |
| import base64 | |
| import os.path | |
| import musicbrainzngs | |
| import mutagen.flac | |
| import mutagen.id3 | |
| import mutagen.mp3 | |
| import mutagen.oggvorbis |