Skip to content

Instantly share code, notes, and snippets.

@JoshuaChi
JoshuaChi / .gitlab.ci.yml
Created July 3, 2021 17:23 — forked from yannhowe/.gitlab.ci.yml
.gitlab.ci.yml for SSH with private key.
# Image neeeds to have ssh-client
image: docker:git
services:
- docker:dind
stages:
- staging
before_script:
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
@JoshuaChi
JoshuaChi / tcp_demo.go
Created November 6, 2021 14:51 — forked from hyper0x/tcp_demo.go
The interaction demo via TCP in Golang.
package main
import (
"bufio"
"bytes"
"fmt"
"io"
"log"
"net"
"os"
@JoshuaChi
JoshuaChi / scanner.go
Created January 22, 2022 12:45 — forked from xialeistudio/scanner.go
Golang实现自定义TCP协议
```go
package main
import (
"bufio"
"bytes"
"encoding/binary"
"fmt"
"io"
)
@JoshuaChi
JoshuaChi / aggregation.sql
Created August 8, 2023 13:45 — forked from confluentgist/aggregation.sql
ksqlDB example: Continuously aggregating a stream into a table with a push query
-- Continuously aggregating a stream into a table with a ksqlDB push query.
CREATE STREAM locationUpdatesStream ...;
CREATE TABLE locationsPerUser AS
SELECT username, COUNT(*)
FROM locationUpdatesStream
GROUP BY username
EMIT CHANGES;
@JoshuaChi
JoshuaChi / topic-as-table.sql
Created August 8, 2023 14:49 — forked from confluentgist/topic-as-table.sql
ksqlDB example: read topic as table
-- Create ksqlDB table from Kafka topic.
CREATE TABLE myTable (username VARCHAR, location VARCHAR)
WITH (KAFKA_TOPIC='input-topic', KEY='username', VALUE_FORMAT='...');
@JoshuaChi
JoshuaChi / topic-as-stream.sql
Created August 8, 2023 14:49 — forked from confluentgist/topic-as-stream.sql
ksqlDB example: read topic as stream
-- Create ksqlDB stream from Kafka topic.
CREATE STREAM myStream (username VARCHAR, location VARCHAR)
WITH (KAFKA_TOPIC='input-topic', VALUE_FORMAT='...');
@JoshuaChi
JoshuaChi / clojure_m1.md
Created September 12, 2024 02:48 — forked from bhb/clojure_m1.md
How to set up Clojure on M1 using Homebrew: A thread

How to set up Clojure on M1 using Homebrew: A thread

I’m upgrading from a Mid 2014 MacBook Pro, so this isn’t a fair comparison to recent Intel machines, but if you’re like me and were waiting for a MacBook with a decent keyboard, you’ll see a big speed boost.

Non-scientific comparison - time to compile my ClojureScript project

  • Mid 2014 MacBook Pro - 14s
  • M1 Pro MacBook Pro (under Rosetta) - 17s
  • M1 Pro MacBook Pro (native) - 6s