OpenTracing == traces ( jaeger/tokio-tracing )
OpenCensus == metrics ( grafana/prometheus )
OpenTelemetry == traces && metrics ( et al. )
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
| def fill-env-var [] { | |
| let current_prompt = (commandline) | |
| let var_idx = $current_prompt | str index-of "$env." --end | |
| let head = match $var_idx { | |
| # no '$env.' was found | |
| -1 => return | |
| 0 => "" | |
| $idx => ($current_prompt | str substring ..($idx - 1)) | |
| } | |
| # 5 is the offset for f in '$env.foo` |
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
| def git-icon [ | |
| colour # ansi colour argument | |
| one # icon for a match quantity of one | |
| many # icon for a match quantity of two or more | |
| ]: int -> oneof<string, nothing> { | |
| let icon = match $in { | |
| 1 => $one | |
| 2.. => $many | |
| _ => (return null) | |
| } |
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
| def is-help []: list<any> -> bool { | |
| ('-h' in $in) or ('--help' in $in) | |
| } | |
| export def fd --wrapped [...$args]: nothing -> oneof<list<string>, nothing> { | |
| if ($args | is-help) { | |
| return (^fd ...$args) | |
| } | |
| ^fd ...$args | lines | |
| } |
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
| def hmode [] { | |
| let entry = pmget | where setting == "hibernatemode" | |
| let name = match ($entry.mode.0 | into int) { | |
| 3 => "off" | |
| 25 => "on" | |
| 0 => "hard" | |
| $n => $n | |
| } | |
| {hibernate: $name } | |
| } |
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
| ---cargo | |
| [dependencies] | |
| tree-sitter-wit = { git = "https://github.com/bytecodealliance/tree-sitter-wit", version = "1.2.0" } | |
| tree-sitter = "0.25.10" | |
| --- | |
| use tree_sitter::{Parser, Point, Query, QueryCursor, StreamingIterator}; | |
| const WIT_FILE: &str = " | |
| /// DOC COMMENT `wasmcloud` |
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
| local read_buf = function(bufnr) | |
| local bufin = table.concat(vim.api.nvim_buf_get_lines(bufnr, 0, -1, true), "\n") | |
| if vim.api.nvim_get_option_value("eol", { buf = bufnr }) then bufin = bufin .. "\n" end | |
| return bufin | |
| end | |
| local format_buf = function(fmt_cmd) | |
| -- exit early if buffer is not writeable | |
| if vim.bo.modifiable == false or vim.bo.readonly == true then return end | |
| -- save cursor position |
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 = 48; | |
| function line(point1, point2, width = 1) = | |
| let(angle = 90 - atan((point2[1] - point1[1]) / (point2[0] - point1[0]))) | |
| let(offset_x = 0.5 * width * cos(angle), offset_y = 0.5 * width * sin(angle)) | |
| let(offset1 = [-offset_x, offset_y], offset2 = [offset_x, -offset_y]) |
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
| #[macro_export] | |
| macro_rules! record { | |
| ($($fields:tt)+) => { | |
| let fieldset = tracing::fieldset!($($fields)+); | |
| $crate::valueset!(fieldset, $($fields)+); | |
| }; | |
| } | |
| #[macro_export] | |
| macro_rules! valueset { |
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
| include <relativity.scad/relativity.scad> | |
| $fn = 20; | |
| module base() { | |
| minkowski() { | |
| box([30, 80, 4]); | |
| cylinder(0.5, r = 4); | |
| } | |
| } |
NewerOlder