Blog 2020/9/1
<- previous | index | next ->
updated 2025/4/2
| const std = @import("std"); | |
| // DTO for deserialization | |
| const LLMResponse = struct { | |
| id: []const u8, // Unique identifier for the response | |
| object: []const u8, // Type of object returned | |
| created: u32, // Unix timestamp of when the response was generated | |
| model: []const u8, // Name of the model used to generate the response | |
| usage: ?struct { // Usage statistics for the response, optional | |
| prompt_tokens: u32, // Number of tokens in the prompt |
Blog 2020/9/1
<- previous | index | next ->
updated 2025/4/2
This snippet is a sample showing how to implement CloudWatch Logs streaming to ElasticSearch using terraform.
I wrote this gist because I didn't found a clear, end-to-end example on how to achieve this task. In particular,
I understood the resource "aws_lambda_permission" "cloudwatch_allow" part by reading a couple of bug reports plus
this stackoverflow post.
The js file is actually the Lambda function automatically created by AWS when creating this pipeline through the
web console. I only added a endpoint variable handling so it is configurable from terraform.
docker run -d -p 9000:9000 --name minio minio/minio server /export
docker logs minio
I have been an aggressive Kubernetes evangelist over the last few years. It has been the hammer with which I have approached almost all my deployments, and the one tool I have mentioned (shoved down clients throats) in almost all my foremost communications with clients, and it was my go to choice when I was mocking my first startup (saharacluster.com).
A few weeks ago Docker 1.13 was released and I was tasked with replicating a client's Kubernetes deployment on Swarm, more specifically testing running compose on Swarm.
And it was a dream!
All our apps were already dockerised and all I had to do was make a few modificatons to an existing compose file that I had used for testing before prior said deployment on Kubernetes.
And, with the ease with which I was able to expose our endpoints, manage volumes, handle networking, deploy and tear down the setup. I in all honesty see no reason to not use Swarm. No mission-critical feature, or incredibly convenient really nice to have feature in Kubernetes that I'm go
Wow. Stripped-down, reading-ready summary follows below, but here's the original link:
https://twitter.com/sarahmei/status/783340259073335296
The author, Sarah Mei (@sarahmei) has also registered liveablecode.com (no content yet).
[begin summary]
Simple module that makes gears with circular-shaped teeth. The gears maintain their shape even for extremely low teeth numbers up to 2. Parameters:
teeth: number of teeth.step: width of one teeth (diameter of the circle).Two gears produced with the same step will transfer movement, so one
typically fixes a step for all the gears and varies teeth for each gear,
which decides the radius and transfer ratio. Example:
| (defn code-mirror | |
| "Create a code-mirror editor. The parameters: | |
| value-atom (reagent atom) | |
| when this changes, the editor will update to reflect it. | |
| options | |
| :style (reagent style map) | |
| will be applied to the container element | |
| :js-cm-opts | |
| options passed into the CodeMirror constructor | |
| :on-cm-init (fn [cm] -> nil) |