- check
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
import { Application, Router } from "https://deno.land/x/oak/mod.ts"; | |
const app = new Application(); | |
const router = new Router(); | |
// Route to serve index.html | |
router.get("/", async (context) => { | |
try { | |
const indexHtml = await Deno.readTextFile("./index.html"); | |
context.response.headers.set("Content-Type", "text/html"); |
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 xs2.nu * | |
.cat | stateful filter {messages: {} marked: {}} { | |
|state frame| | |
if $frame == null { | |
return {out: $state} | |
} | |
if $frame.topic != "discord.ws.recv" { return {} } | |
let message = ($frame | .cas $in.hash | from json) |
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 bash | |
# select a tmux window (ordered by recent used) with fzf and focus | |
tmux list-windows -F "#{window_activity} #{window_index} #{window_name}" | | |
sort -nrk 1 | | |
cut -d' ' -f2- | | |
fzf | | |
cut -d' ' -f1 | | |
xargs -I {} tmux select-window -t ':{}' |
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
alias and-then = if ($in | is-not-empty) | |
alias ? = if ($in | is-not-empty) { $in } | |
alias ?? = ? else { return } | |
def build-query [params] { | |
$params | columns | each { |x| | |
let value = ($params | get $x) | |
match ( $value | describe ) { | |
"string" => $"($x)=($value)", | |
"bool" => (if $value { $x }), |
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
~/.s/sessions/03B982FI3LF406403X7R7HD9Z/nushell: "foo" | example echo | |
foo | |
~/.s/sessions/03B982FI3LF406403X7R7HD9Z/nushell: seq 1 5 | each { |n| sleep 1sec; $n } | example echo | first | |
1 | |
Error: × Main thread panicked. | |
├─▶ at crates/nu-protocol/src/engine/stack.rs:88:13 | |
╰─▶ More than one stack reference remaining! | |
0: 0x106fc4e54 - rust_begin_unwind | |
at /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04/library/std/src/panicking.rs:647 | |
1: 0x10704945c - core::panicking::panic_fmt::h1cb43b60f5788132 |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1" /> | |
<link rel="icon" href="/icon.ico" type="image/x-icon"> | |
{% if tld == "stacks" %} |
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
2024-02-29 08:33:48.441 PM [TRACE] nu_cli::repl: [crates/nu-cli/src/repl.rs:776] eval source: http get https://ndyg.cross.stream/projects/chat-app/messages | from sse | |
2024-02-29 08:33:48.442 PM [TRACE] nu_parser::parser: [crates/nu-parser/src/parser.rs:5752] parsing block: LiteBlock { block: [LitePipeline { commands: [Command(None, LiteCommand { comments: [], parts: [Span { start: 125515, end: 125519 }, Span { start: 125520, end: 125523 }, Span { start: 125524, end: 125576 }] }), Command(Some(Span { start: 125578, end: 125579 }), LiteCommand { comments: [], parts: [Span { start: 125580, end: 125584 }, Span { start: 125585, end: 125588 }] })] }] } | |
2024-02-29 08:33:48.442 PM [TRACE] nu_parser::parser: [crates/nu-parser/src/parser.rs:5586] parsing: pipeline element: command | |
2024-02-29 08:33:48.442 PM [TRACE] nu_parser::parser: [crates/nu-parser/src/parser.rs:5065] parsing: expression | |
2024-02-29 08:33:48.442 PM [TRACE] nu_parser::parser: [crates/nu-parser/src/parser.rs:2303] parsing: filesize | |
2024-02-29 08:33:48 |
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
``` | |
iter | |
and go | |
write: false | |
iter | |
write: Ok | |
want lock | |
have lock | |
process_value: [] | |
iter |
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
``` | |
~/.s/sessions/03B982FI3LF406403X7R7HD9Z/nushell: http get https://ndyg.cross.stream/projects/chat-app/messages | from sse 02/29/2024 03:27:45 PM PM | |
want lock | |
have lock | |
ready to write | |
iter | |
and go | |
write: false | |
write: Ok | |
iter |