Skip to content

Instantly share code, notes, and snippets.

@maxim
maxim / gh-dl-release
Last active March 29, 2024 16:41
Download assets from private Github releases
#!/usr/bin/env bash
#
# gh-dl-release! It works!
#
# This script downloads an asset from latest or specific Github release of a
# private repo. Feel free to extract more of the variables into command line
# parameters.
#
# PREREQUISITES
#
@ashrithr
ashrithr / kafka.md
Last active March 14, 2024 21:16
kafka introduction

Introduction to Kafka

Kafka acts as a kind of write-ahead log (WAL) that records messages to a persistent store (disk) and allows subscribers to read and apply these changes to their own stores in a system appropriate time-frame.

Terminology:

  • Producers send messages to brokers
  • Consumers read messages from brokers
  • Messages are sent to a topic
@Papierkorb
Papierkorb / 000_HOWTO.md
Last active March 9, 2024 17:59
Dynamic library in Crystal

Writing a dynamic library in Crystal, and calling it from C

  • Download all files.
  • Build the Crystal part:
crystal build --release --cross-compile --prelude ./no_main library.cr
              ^ You can leave this out
                        ^ We want to link ourselves!
 ^ Use our custom prelude!
@jkreps
jkreps / benchmark-commands.txt
Last active January 21, 2024 11:02
Kafka Benchmark Commands
Producer
Setup
bin/kafka-topics.sh --zookeeper esv4-hcl197.grid.linkedin.com:2181 --create --topic test-rep-one --partitions 6 --replication-factor 1
bin/kafka-topics.sh --zookeeper esv4-hcl197.grid.linkedin.com:2181 --create --topic test --partitions 6 --replication-factor 3
Single thread, no replication
bin/kafka-run-class.sh org.apache.kafka.clients.tools.ProducerPerformance test7 50000000 100 -1 acks=1 bootstrap.servers=esv4-hcl198.grid.linkedin.com:9092 buffer.memory=67108864 batch.size=8196
@keplersj
keplersj / logged.rs
Created July 25, 2015 21:00
Gist demonstrating the ability to run Crystal code from Rust.
#[link(name = "logger")]
extern {
fn CrystalLog(text: *const u8);
}
fn log(text: &'static str) {
unsafe{ CrystalLog(text.as_bytes().as_ptr()) };
}
fn main() {
@statico
statico / pom.xml
Last active August 24, 2023 23:21
minimal maven pom.xml to download JARs in to a lib/ directory
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.foo</groupId>
<artifactId>bar</artifactId>
<version>0.0.1-SNAPSHOT</version>
@clemensg
clemensg / curl_multi_test.c
Last active June 28, 2023 06:51
libcurl multi interface example
/* curl_multi_test.c
Clemens Gruber, 2013
<clemens.gruber@pqgruber.com>
Code description:
Requests 4 Web pages via the CURL multi interface
and checks if the HTTP status code is 200.
Update: Fixed! The check for !numfds was the problem.
@everpeace
everpeace / Why People Want Microservices.md
Last active November 8, 2022 10:37
マイクロサービス化が進む背景について考えてみた

マイクロサービス化が進む背景について考えてみた

最近マイクロサービスって流行ってますよね。バズってると言ってもいいくらい。

個人的には、「マイクロサービスって結局何なの?」とか、「SOAと何が違うわけ?」とかいう議論は苦手です。

でも「なんでみんなマイクロサービスで作りたいのか?なんでマイクロサービスで作られるサービスが多いのか?」にはすごく興味があるんです。

僕は今、シリコンバレーにある日系SIerの小さな子会社で駐在員をやっていますが、このエリアに居ると、とにかく最近、

「サービス全体が、独立した小さなサービスの集合で構成されるようになってきている」

@deltheil
deltheil / libcurl_dns.md
Last active March 15, 2019 00:54
libcurl options to control DNS lookup (cache, timeout, resolving time, etc). The short URL for this page is: http://git.io/libcurl-dns.

Easy handle interface

Options

Info

package org.iainhull.akka
import scala.concurrent.duration._
import akka.actor._
import akka.event.Logging
import akka.pattern.ask
import akka.util.Timeout
import akka.persistence.{PersistentView, AtLeastOnceDelivery, PersistentActor}