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 hue-auto-login-from-oauth2-proxy.md

oauth2-proxy

docker-compose.yml

replace MYDOMAIN, MYHOST

version: '2'
services:
  oauth2-proxy-4181:
View bootstrap4.md

tooltip: max-width

.tooltip-inner {
  white-space: pre-wrap;
  max-width: 100%;
}

table: prevent 100% width

View ひらがないず.md

目的

  • 任意の日本語文章(UTF-8)を「ひらがな化」する

結論

  • ipadic-utf8 で mecab -Oyomi | nkf --hiragana がバランスよさげ
$ ls -l dic
合計 0
View 1.ubuntu-18.04.md
View csv-quote-all.md

(SUMMARY)

Language Library Name Type
C# CsvHelper QuoteAllFields bool
Go (stdlib) N/A N/A
Haskell cassava Quoting.QuoteAll enum
Java Apache Commons CSV QuoteMode.ALL enum
Python (stdlib) QUOTE_ALL enum
Ruby fastercsv force_quotes bool
@maiha
maiha / 0.25.md
Last active Jun 27, 2018
Crystal breaking changes
View 0.25.md

std

JSON

  • JSON::Type is moved to JSON::Any::Type
-  def [](key) : YAML::Type
+  def [](key) : YAML::Any::Type
View 1.duck-typing-ok.md

[OK] 1.rb

require "json"

def convert_to_json(obj)
  obj.to_json
end

p convert_to_json(1)   # => "1"
p convert_to_json("x") # => "\"x\""
@maiha
maiha / 0.kafkaのexactly once.md
Last active Apr 4, 2018
kafka-1.0-exactly-once
View 0.kafkaのexactly once.md

情報

概要

  • kafka-0.11 で導入された idempotent producer によって同一パーティション内の冪等性を保証
  • produce request v3 で導入された transaction 機能により、複数メッセージのアトミック処理を保証

チートシート(擬似コード)

View 1.CompositeLogger.cr
class CompositeLogger
def initialize(@loggers : Array(Logger) = loggers)
end
macro method_missing(call)
@loggers.each do |logger|
logger.{{call}}
end
end
end
You can’t perform that action at this time.