- Delete unused or obsolete files when your changes make them irrelevant (refactors, feature removals, etc.), and revert files only when the change is yours or explicitly requested. If a git operation leaves you unsure about other agents' in-flight work, stop and coordinate instead of deleting.
- Before attempting to delete a file to resolve a local type/lint failure, stop and ask the user. Other agents are often editing adjacent files; deleting their work to silence an error is never acceptable without explicit approval.
- NEVER edit
.envor any environment variable files—only the user may change them. - Coordinate with other agents before removing their in-progress edits—don't revert or delete work you didn't author unless everyone agrees.
- Moving/renaming and restoring files is allowed.
- ABSOLUTELY NEVER run destructive git operations (e.g.,
git reset --hard,rm,git checkout/git restoreto an older commit) unless the user gives an explicit, written instruction in this conversation. Treat t
Example of a bare-minimum terraform script to setup an API Gateway endpoint that takes records and puts them into an SQS queue.
Start by creating the SQS queue.
resource "aws_sqs_queue" "queue" {
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
| class EnrichmentBuilder { | |
| constructor(baseEvent) { | |
| this.baseEvent = baseEvent; | |
| this.enrichments = []; | |
| } | |
| addEnrichment({ name, value, type, data }) { | |
| const enrichment = { name, value }; | |
| if (type) enrichment.type = type; | |
| if (data) enrichment.data = data; |
The standard way of understanding the HTTP protocol is via the request reply pattern. Each HTTP transaction consists of a finitely bounded HTTP request and a finitely bounded HTTP response.
However it's also possible for both parts of an HTTP 1.1 transaction to stream their possibly infinitely bounded data. The advantages is that the sender can send data that is beyond the sender's memory limit, and the receiver can act on
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
| const http2 = require('http2'); | |
| const fs = require('fs'); | |
| const path = require('path'); | |
| const zlib = require('zlib'); | |
| const brotli = require('brotli'); // npm package | |
| const PORT = 3032; | |
| const BROTLI_QUALITY = 11; // slow, but we're caching so who cares | |
| const STATIC_DIRECTORY = path.resolve(__dirname, '../dist/'); | |
| const cache = {}; |
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
| async function doSomething() { | |
| return new Promise((resolve, reject) => { | |
| setTimeout(() => resolve("done!"), 1000) | |
| }); | |
| } | |
| // Rejection case | |
| async function doSomethingBad() { | |
| return new Promise((resolve, reject) => { | |
| setTimeout(() => reject("crap!"), 1000) |
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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <graphml xmlns="http://graphml.graphdrawing.org/xmlns" | |
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns | |
| http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd"> | |
| <key id="x" for="node" attr.name="x" attr.type="double"/> | |
| <key id="tooltip" for="node" attr.name="tooltip" attr.type="string"/> | |
| <key id="y" for="node" attr.name="y" attr.type="double"/> |