Instantly share code, notes, and snippets.

View run.md
$ curl -H 'Accept-Encoding: gzip' http://staff.livedoor.blog/ > x1
$ crystal test.cr > x2

$ LC_ALL=C ls -l x1 x2
-rw-rw-r-- 1 maiha maiha 13786 Feb 10 10:00 x1
-rw-rw-r-- 1 maiha maiha 13602 Feb 10 10:06 x2

$ file x1 x2
x1: gzip compressed data, last modified: Sun Feb 10 01:00:48 2019, from Unix
View sse.md

nginx

location /sse/ {
  # enables EventSource support
  proxy_http_version 1.1;
  proxy_set_header Connection "";

  proxy_buffering off;
}
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
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\""