Skip to content

Instantly share code, notes, and snippets.

maiha

Block or report user

Report or block maiha

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View install scala-sbt on ubuntu 18.04.md

Java

sudo apt update  
sudo apt install oracle-java8-installer  
sudo apt install oracle-java8-set-default  

scala

sudo apt-get remove scala-library scala  
@statico
statico / pom.xml
Last active Feb 24, 2020
minimal maven pom.xml to download JARs in to a lib/ directory
View pom.xml
<?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 Dec 22, 2016
Use Crystal on CircleCI
View circle.yml
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 Feb 26, 2020
Download assets from private Github releases
View gh-dl-release
#!/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 Jul 27, 2015
mecabひらがな変換
View mecab_hiragana.md
$ echo "2015/07/27: 明日は晴れだ" | mecab -Oyomi | nkf -w --hiragana
2015/07/27: あしたははれだ
@everpeace
everpeace / Why People Want Microservices.md
Last active Feb 7, 2020
マイクロサービス化が進む背景について考えてみた
View Why People Want Microservices.md

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

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

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

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

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

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

View kafka.md

Apache Kafka

"A high-throughput distributed messaging system." site

Notes taken from source

Overview

  • Created at LinkedIn (open sourced in 2011)
View OrderExampleReliable.scala
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 Feb 20, 2020
Kafka Benchmark Commands
View benchmark-commands.txt
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
View Functors.scala
// covariant functor
trait Functor[F[_]] {
def fmap[A, B](f: A => B): F[A] => F[B]
}
// contravariant functor
trait Contravariant[F[_]] {
def contramap[A, B](f: B => A): F[A] => F[B]
}
You can’t perform that action at this time.