| 命令 | 说明 + 示例 | |
|---|---|---|
| ds | 删除括号 | |
| 例 | ds " |
"Hello world!" =>Hello world! |
| cs | 替换括号 | |
| 例 | cs "( |
"Hello world!" =>(Hello world!) |
| cS | 替换括号,括号内文本做新一行 | |
| 例 | cS "{ |
"Hello world!" => { Hello world! } |
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
| // NOTE: This is now rolled up in a package and supports more scenarios: https://github.com/dsherret/using-statement | |
| interface IDisposable { | |
| dispose(); | |
| } | |
| function using<T extends IDisposable>(resource: T, func: (resource: T) => void) { | |
| try { | |
| func(resource); | |
| } finally { |
Server-Sent events is a specification for implementing server-side-push for web frontend applications, through plain-old HTTP.
It is best contrasted with WebSockets, which offer a full-duplex messaging channel over a custom protocol, operating within a single TCP connection (with an HTTP-compatible handshake).
- Clone this gist
node server.js