sequenceDiagram
participant Client
participant Server
Client->>Server: HTTP request
Server->>Client: HTTP response
sequenceDiagram
'use strict' | |
// see: https://github.com/nodejs/node/pull/6157 | |
var startTime = process.hrtime() | |
var startUsage = process.cpuUsage() | |
// spin the CPU for 500 milliseconds | |
var now = Date.now() | |
while (Date.now() - now < 500) |
sequenceDiagram
participant Client
participant Server
Client->>Server: HTTP request
Server->>Client: HTTP response
sequenceDiagram
<!-- | |
====================================================================== | |
Example trying to show hooking addEventListener to see if we can | |
capture error state for errors that occur in the handler. | |
Basically, we can capture that an error occurred, and get the | |
error message, and the event and object that was fired that | |
caused code to run that caused the error. But no stack trace | |
or line information. |
#!/usr/bin/env node | |
const pathMod = require('node:path') | |
const PROGRAM = pathMod.basename(__filename) | |
const [issue, branch] = process.argv.slice(2) | |
if (!issue || !branch) { | |
console.log(` | |
Usage: ${PROGRAM} <issue #> <git branch name> |
'use strict' | |
// examples from https://github.com/vriad/zod | |
// trying to use zod in JS w/ jsdoc type comments in vsCode | |
const z = require('zod') | |
const dogSchema = z.object({ | |
name: z.string(), |
# https://www.elastic.co/guide/en/elasticsearch/reference/master/esql.html | |
POST /_query | |
{ | |
"query": """ | |
FROM .kibana-event-log-* | |
| WHERE event.provider == "alerting" | |
| WHERE event.action == "execute" |
{"attributes":{"fieldAttrs":"{\"provider_rule_type\":{\"count\":1},\"event.action\":{\"count\":1}}","fieldFormatMap":"{\"event.duration\":{\"id\":\"duration\",\"params\":{\"parsedUrl\":{\"origin\":\"https://pmuellr-8-7-0.kb.us-central1.gcp.cloud.es.io:9243\",\"pathname\":\"/app/management/kibana/dataViews/patterns/kibana-event-log\",\"basePath\":\"\"},\"inputFormat\":\"nanoseconds\",\"outputFormat\":\"asSeconds\",\"outputPrecision\":2,\"includeSpaceWithSuffix\":true,\"showSuffix\":true,\"useShortSuffix\":true}}}","fields":"[]","name":"ow23-05-event-log","runtimeFieldMap":"{\"provider_rule_type\":{\"type\":\"keyword\",\"script\":{\"source\":\"def provider = doc[\\\"event.provider\\\"];\\ndef ruleTyp1 = doc[\\\"rule.category\\\"];\\ndef ruleTyp2 = doc[\\\"kibana.alert.rule.rule_type_id\\\"];\\n\\nif (provider == null || provider.size() == 0) return;\\n\\nif (ruleTyp1 != null && ruleTyp1.size() != 0) {\\n emit(provider.value + \\\"::\\\" + ruleTyp1.value);\\n return;\\n} \\n\\nif (ruleTyp2 != null && ruleT |
#!/usr/bin/env node | |
fs = require("fs") | |
path = require("path") | |
child_process = require("child_process") | |
//------------------------------------------------------------------------------ | |
PROGRAM = path.basename(__filename) | |
VERSION = "0.2.0.2012-10-09" |
#!/usr/bin/env npx zx | |
import https from 'node:https' | |
import path from 'node:path' | |
const NAME = path.basename(import.meta.url) | |
$.verbose = false | |
const KBN_URL = process.env.KBN_URL |
#!/usr/bin/env node | |
const fs = require('fs') | |
const [ fileName ] = process.argv.slice(2) | |
if (fileName == null) { | |
console.error('input file with search response required') | |
process.exit(0) | |
} |