Commands | Description |
---|---|
XADD mystream * message 1 | Add to stream to insert {message: 1} |
XLEN mystream | Length of messages in mystream |
XRANGE mystream - + COUNT 2 | Return the first two elements |
XREAD COUNT 2 STREAMS mystream 0 | Read 2 elements in stream from the beginning |
XREAD BLOCK 0 STREAMS mystream $ | Wait indefinitely until a message |
XREAD BLOCK 1000 STREAMS mystream $ | Wait for 1 second for a message else timeout |
XGROUP CREATE mystream group1 $ | Create a group1 in consumer group in a stream |
XREADGROUP GROUP group1 cons1 COUNT 1 STREAMS mystream > | Consume new messages as cons1 in group1 and get all the new messages |
// Thank you to the folks at the C++ slack channel, | |
// along with @lewissbaker for the excellent literature | |
// (even though it took me a few days to be convinced | |
// it really was so). | |
#include <uv.h> | |
#include <iostream> | |
#include <experimental/coroutine> |
@page "/" | |
@using System.Net.WebSockets | |
@using System.Text | |
@using System.Threading | |
@implements IDisposable | |
<h1>Echo test</h1> | |
<h3>State: @webSocket.State</h3> | |
@if (webSocket.State == WebSocketState.Open) |
Packaging JavaScript applications can be a bit overwhelming. The popular project uglifyjs does not support ES6, it is cumbersome to configure the allmighty Webpack, bundlers like Parcel and Microbundle still have bugs or do not compile to ESM bundles that work in a browser. It is hard to figure out the best way to bundle an application.
Here I give a small example, how we achieve the goal using the
- TypeScript compiler
- rollup.js bundler
C++ links: Coroutines
https://github.com/MattPD/cpplinks / C++ Standard / C++20 / Coroutines
(draft; work in progress)
#coroutines (C++ Slack): https://cpplang.slack.com/archives/C5JS5JXT5
Minimal example making webpack and wasm/Emscripten work together.
Build instructions:
- Clone this gist
npm install
npm start
- Open
http://localhost:8080
- Look at console
<!DOCTYPE html> | |
<html> | |
<head> | |
</head> | |
<body> | |
<h2>Transcript</h2> | |
<div id="transcript"><?div> | |
<script> | |
var app = { |
A non-exhaustive list of WebGL and WebGPU frameworks and libraries. It is mostly for learning purposes as some of the libraries listed are wip/outdated/not maintained anymore.
Name | Stars | Last Commit | Description |
---|---|---|---|
three.js | ![GitHub |