Skip to content

Instantly share code, notes, and snippets.

@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!
@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>
@DanSnow
DanSnow / circle.yml
Created December 22, 2016 05:32
Use Crystal on CircleCI
machine:
environment:
CRYSTAL_VERSION: "0.20.1" # Replace version to which you're using
PATH: "${PATH}:${HOME}/.crystal/bin"
CRYSTAL_URL: "https://github.com/crystal-lang/crystal/releases/download/${CRYSTAL_VERSION}/crystal-${CRYSTAL_VERSION}-1-linux-x86_64.tar.gz"
dependencies:
cache_directories:
- ~/.crystal
- lib
- .shards
@maxim
maxim / gh-dl-release
Last active April 29, 2024 08:55
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
#
@foo9
foo9 / mecab_hiragana.md
Created July 27, 2015 06:50
mecabひらがな変換
$ echo "2015/07/27: 明日は晴れだ" | mecab -Oyomi | nkf -w --hiragana
2015/07/27: あしたははれだ
@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() {
@everpeace
everpeace / Why People Want Microservices.md
Last active November 8, 2022 10:37
マイクロサービス化が進む背景について考えてみた

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

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

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

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

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

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

@mathyourlife
mathyourlife / kafka.md
Created September 17, 2014 13:45
kafka notes

Apache Kafka

"A high-throughput distributed messaging system." site

Notes taken from source

Overview

  • Created at LinkedIn (open sourced in 2011)
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}
@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