Skip to content

Instantly share code, notes, and snippets.

View cablehead's full-sized avatar

Andy Gayton cablehead

View GitHub Profile
<!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" %}
@cablehead
cablehead / 01-small-tools-everywhere.md
Last active March 1, 2024 15:11
small tools everywhere

What would it look like if we just used small tools, everywhere?

Original revision: Sep 6, 2018

Most developers are familiar and proponents of the Unix Philosophy Unix philosophy - Wikipedia particularly, Write programs that do one thing and do it well. In practice though, the tooling just doesn’t exist to build useful network services which follow this approach.

Let’s take a lightweight WebSocket service. In 2018 we’ve no shortage of languages and frameworks - however largely incompatible with each other, to create the service.

I’m most familiar with the Python world so can break out the different frameworks in that world that you could use: twisted, eventlet, gevent, tornado, asyncio, sanic - and even though these use the same base language, using libraries designed to be used with one of these frameworks would likely be difficult to use with another framework. And then there are also a myriad of options with Java, Golang, Erlang, Rust.

@cablehead
cablehead / stream.out
Created February 29, 2024 20:37
stream-with-trace.out
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
```
iter
and go
write: false
iter
write: Ok
want lock
have lock
process_value: []
iter
```
~/.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
@cablehead
cablehead / Cargo.toml
Last active November 19, 2023 03:06
example for UnexpectedEof error on successful HTTP/2 TLS requests with Hyper v1.0.1
[package]
name = "hv1-tls-eof"
version = "0.1.0"
edition = "2021"
[dependencies]
hyper = { version = "1.0.1", features = ["full"] }
tokio = { version = "1", features = ["full"] }
http-body-util = "0.1"
hyper-util = { version = "0.1.1", features = ["full"] }
@cablehead
cablehead / version.json
Last active May 26, 2023 20:09
Tauri updater
{
"version": "v0.3.3",
"notes": "Test version",
"pub_date": "2023-05-26T15:26:38-04:00",
"platforms": {
"darwin-aarch64": {
"signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVTTm5wRE5ISjZKcEFsWFluWEZVcEs3eVNUUGdWanNqTnBqNzB2SENXaGppaXdZVms3enhlVExtbythTTNHVGg2TVIzQ2ZNTjFWME9wWTJGNERQUkxOMVRIVXAyc2pVYkFBPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNjg1MTI4OTgyCWZpbGU6U3RhY2tzLmFwcC50YXIuZ3oKUXVoK2wrZ052WjFYTzFoM2UxWHhCNnhaKzJnQ1lRODJ2YXVodk9QbzAyRnZ5VCt2eDNvdTFoNHdsbDZmS1RIUldIZEliZk9WWGhYZDd1UUl5WFVYQVE9PQo=",
"url": "https://github.com/cablehead/stacks/releases/download/v0.3.4/Stacks_0.3.4_aarch64.app.tar.gz"
}
}
@cablehead
cablehead / 01-pull-open-graph.sh
Last active April 5, 2022 12:32
shell snippet to query a webpage and extract it's opengraph meta data as json
curl -s https://ogp.me | pup 'head meta json{}' | \
jq '.[] | select(.property) | select(.property | contains("og:")) | {(.property) : (.content)}' | \
jq -s add