- 非同期処理でサーバー落ちた話
- AmazonSNSでslackに通知するようにした話
- 物理サーバー時代の障害
- sshdのプロセスを間違えて削除して、入れなくなった
- サーバー会社に連絡して、rebootしてもらった
- HDDの劣化を確認
- S.M.A.R.Tを見て、使用状況をみる
- sshdのプロセスを間違えて削除して、入れなくなった
- Karnelアップデートで失敗
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Family | |
def self.build | |
yield | |
end | |
end | |
x = Family.build do |family| | |
family.new_child('john') do |child| | |
child.hobby = 'game' | |
child.age = 18 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'open-uri' | |
require 'nokogiri' | |
require 'benchmark' | |
Benchmark.bm do |r| | |
r.report do | |
pages = {} | |
[*1..100].each do |no| | |
url = "http://matome.naver.jp/search?q=%e5%90%8d%e8%a8%80&page=#{no}" | |
doc = Nokogiri::HTML.parse(open(url)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'open-uri' | |
require 'nokogiri' | |
require 'benchmark' | |
require 'parallel' | |
Benchmark.bm do |r| | |
r.report do | |
pages = {} | |
Parallel.each([*1..100], in_threads: 4) do |no| | |
url = "http://matome.naver.jp/search?q=%e5%90%8d%e8%a8%80&page=#{no}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rake/clean' | |
CLOBBER.include('hello') | |
SRC_DISTDIR = './helloworld' | |
directory SRC_DISTDIR | |
CC = 'gcc' | |
str = <<EOS | |
#{CC} -o hello hello.c | |
./hello | |
EOS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="description" content="誰でもできる美味しいカレーのレシピです"> | |
<title>誰でもできる美味しいカレーのレシピ</title> | |
</head> | |
<body> | |
<header> | |
<h1>カレーのレシピ</h1> |
##markdown記法 引用Wikipedia
Markdown(マークダウン)は、文書を記述するための軽量マークアップ言語のひとつである。もとはプレーンテキスト形式で手軽に書いた文書からHTMLを生成するために開発された。現在ではHTMLのほかパワーポイント形式やLATEX形式のファイルへ変換するソフトウェア(コンバータ)も開発されている。各コンバータの開発者によって多様な拡張が施されるため、各種の方言が存在する。
強調
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<style> | |
table{ | |
border:solid 1px #000; | |
border-collapse:collapse; | |
} | |
th,td{ | |
padding:5px; |