Skip to content

Instantly share code, notes, and snippets.

require 'net/http'
require 'open-uri'
require 'fileutils'
require 'nokogiri'
class KonoiroIinaCollector
BASE_URL = 'https://webnewtype.com'.freeze
DEFAULT_RESOLUTION = 'w3600h2700'.freeze
def self.save_all_images(save_dir = nil, resolution = nil)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.17691037058830261</real>

12. ベンチマーキング

12.1 基礎知識

12.1.1 アクティビティ

ベンチマーキングを実施する理由:

  • チューニング
  • 開発
  • 開発中の非回帰テスト (定期的に実行される自動化されたパフォーマンスのテストスイート)
require 'fileutils'
require 'pathname'
require 'open-uri'
require 'net/http'
URL_TEMPLATE = 'http://t7s.jp/image/page/release/ingame/cover/%02d.png'
def save(url, base_path)
puts url
data = open(url).read
@itkq
itkq / annict_list_anime.rb
Created December 27, 2017 12:19
1年で見たアニメを表示するやつ
require 'net/http'
require 'openssl'
require 'json'
require 'optparse'
HEADER = { Authorization: "Bearer #{ENV.fetch('ANNICT_TOKEN')}" }
HOST = 'api.annict.com'
WATCHED_FILTER = -> a { ["watched", "watching"].include?(a["status"]["kind"]) }
SEASON = ["winter", "spring", "summer", "autumn"]
@itkq
itkq / wsa1.md
Created December 20, 2017 08:07
WSA研 #1: サービスのパフォーマンス数値と依存関係を用いたサービス同士の協調スケール構想 / @itkq

WSA研 #1: サービスのパフォーマンス数値と依存関係を用いたサービス同士の協調スケール構想 / @itkq

本稿は WebSystemArchitecture 研究会 #1 の予稿です。

はじめに

近年 Docker をはじめとするアプリケーションコンテナが広く使われており、Kubernetes などのオーケストレーションツールを用いて、オンプレミスだけでなく、マネージドサービス (GKE, ECS, EKS) で使用する例が増えている。 クラウドを意識してアプリケーションを構築する現在、もはや「マイクロサービスアーキテクチャ」というまでもないが、service-to-service で通信するモデルが一般的になりつつある。

そこで Zipkin, OpenTracing などの分散トレーシングや、Envoy, Linkerd, Istio などサービスメッシュが登場し、リクエストの追跡・サービス間メトリクスの取得・サービスディスカバリ・障害分離・カナリアデプロイ・サービス間認証などが現実的に行えるようになっている。しかし、これらは依然として開発基盤よりの目的・技術だといえる。サービスメッシュで構築された基盤の上で動作するサービスを安定して運用するために、サービスメッシュを利用して、サービスをどのようにスケールさせるか、といった運用上の応用、実例はほとんど公開されていない。

#!/bin/bash
set -eu
repos=$1
bin_path=$HOME/bin
os=darwin
cmd=$(echo $repos | cut -d'/' -f2)
release_url=$(curl -sSL https://api.github.com/repos/$repos/releases/latest \
@itkq
itkq / keybindings.json
Last active September 1, 2017 07:24
vscode config
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "ctrl+f",
"command": "cursorRight",
"when": "editorTextFocus"
},
{
"key": "ctrl+b",
"command": "cursorLeft",
@itkq
itkq / 3-4Q.csv
Last active August 22, 2017 14:44
後期輪講日程
Start Date Start Time End Date End Time Location Subject
2017/10/05 15:05 2017/10/05 16:35 Room 300 輪講 (B4*2)
2017/10/05 16:50 2017/10/05 18:20 Room 300 輪講 (M1)
2017/10/12 15:05 2017/10/12 16:35 Room 300 輪講 (M1)
2017/10/12 16:50 2017/10/12 18:20 Room 300 輪講 (M1)
2017/10/16 13:20 2017/10/16 14:50 Room 300 輪講 (D)
2017/10/23 13:20 2017/10/23 14:50 Room 300 輪講 (B4)
2017/10/23 15:05 2017/10/23 16:35 Room 300 輪講 (B4)
2017/10/26 15:05 2017/10/26 16:35 Room 300 輪講 (D)
2017/10/30 13:20 2017/10/30 14:50 Room 300 輪講 (M1)
require 'fileutils'
require 'nokogiri'
require 'open-uri'
BASE_URL = 'http://rst-project.com'
def ordinal n
case n
when 1
"1st"