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
| #!/bin/bash | |
| # Whisper Push-to-Talk Dictation Tool | |
| # Runs whisper.cpp continuously, only processes output when key is held | |
| set -euo pipefail | |
| # Get script directory | |
| SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" |
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
| // Function to fetch paginated GitHub API responses | |
| async function fetchPaginatedGitHubData(url: string, headers: Headers): Promise<any[]> { | |
| let results: any[] = []; | |
| let nextPageUrl: string | null = url; | |
| while (nextPageUrl) { | |
| const response: Response = await fetch(nextPageUrl, { headers }); | |
| const data = await response.json(); | |
| results = results.concat(data); |
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
| /** | |
| * A transducer that can be applied synchronously | |
| */ | |
| export interface Transducer<A, B> { | |
| /** | |
| * Applies the transducer to the given iterable | |
| */ | |
| (iterable: Iterable<A>): Iterable<B>; | |
| /** |
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
| interface Constructor<T = object> { | |
| new(...args: any[]): T; | |
| } | |
| interface Disposable { | |
| dispose(): void; | |
| } | |
| function Disposable<T extends Constructor>(Base: T): T & Constructor<Disposable> { | |
| return class extends Base implements Disposable { |
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
| /* | |
| * Usage: | |
| * const message: IncomingMessage = ... | |
| * const iterator = new AsyncIteratorHandler<string>(); | |
| * message.on("data", chunk => { | |
| * iterator.handle({value: chunk.toString(), done: false}); | |
| * }); | |
| * this.message.on("end", () => { | |
| * iterator.handle({value: null as any, done: true}) | |
| * }); |
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
| <div class="application root"> | |
| <style src="../generated/bundle.css"></style> | |
| <include src="../generated/bundle.svg" selector="svg"></include> | |
| <decorator src="../header/header.html" selector=".header" content=".controls"> | |
| <svg class="close-logo"> | |
| <use xlink:href="#close-logo"></use> | |
| </svg> | |
| </decorator> | |
| <include src="../popup/popup.html" selector=".popup"></include> | |
| <decorator src="../footer/footer.html" selector=".footer"> |
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
| package fun; | |
| import com.googlecode.totallylazy.Streams; | |
| import com.googlecode.totallylazy.io.Uri; | |
| import com.googlecode.utterlyidle.HttpHandler; | |
| import com.googlecode.utterlyidle.Request; | |
| import com.googlecode.utterlyidle.Response; | |
| import com.googlecode.utterlyidle.handlers.ClientHttpHandler; | |
| import com.googlecode.utterlyidle.html.RelativeUrlHandler; | |
| import jodd.lagarto.dom.*; |
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
| #[derive(PartialEq, Debug)] | |
| pub enum StartLine<'a> { | |
| RequestLine (RequestLine<'a>), | |
| StatusLine (StatusLine<'a>), | |
| } | |
| impl <'a> fmt::Display for StartLine<'a> { | |
| fn fmt(&self, format: &mut fmt::Formatter) -> fmt::Result { | |
| match self { | |
| StartLine::RequestLine(rl) => rl.fmt(format), |
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
| fn get<'a>(headers: &'a Vec<(&str, String)>, name:&str) -> Option<&'a str> { | |
| headers.into_iter().find(|&&(key,_)| name.eq_ignore_ascii_case(key)).map(|&(_,&value)|value) | |
| } // ^^^^^^ expected struct `std::string::String`, found reference |
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
| pub fn message_body<'a>(slice: &'a [u8], headers:&Vec<(&str, String)>) -> IResult<&'a [u8], MessageBody<'a>> { | |
| IResult::Done(slice, MessageBody::None) | |
| } | |
| apply!(message_body, &headers) |
NewerOlder