Running Leanの実例として、『Running Lean』執筆の過程を記す。
後続の章の地図になっている。
『Running Lean』は元々ブログで書いていた内容をまとめ、リライトした本である。
import os | |
import sys | |
import time | |
import argparse | |
import boto3 | |
if os.environ.get('AWS_PROFILE') is None: | |
sys.exit('Environment variable AWS_PROFILE not set') | |
argparser = argparse.ArgumentParser(description='Snapshot EC2 instance volume with volume ID specified by argument') |
<%= html_import_tag 'elements' %> |
# coding: utf-8 | |
gem 'epub-parser', '>= 0.2.4' | |
gem 'epub-maker', '0.0.3' | |
require 'English' | |
require 'epub/maker' | |
require 'rouge' | |
require 'rouge/lexers/docker' | |
ROUGE_THEME = 'github' | |
ROUGE_CSS_SCOPE = 'code' |
require 'pathname' | |
def main(middlewares, files) | |
files.each do |filename| | |
pathname = Pathname.new(filename).expand_path | |
raise "No such file: #{filename}" unless pathname.file? | |
content_type = middlewares.inject(nil) {|ct, mw| | |
mw.call(pathname) || ct | |
} | |
$stderr.puts [pathname.to_path, content_type].join(': ') |
[Unit] | |
Description=InfluxDB Server | |
After=network.target | |
[Install] | |
WantedBy=network.target | |
[Service] | |
User=influxdb | |
Group=influxdb |
.book-cover { | |
width: image-width("path/to/image"); | |
max-width: 36px; | |
} |
var a = document.createElement('a'); | |
a.addEventListener("click", function(event) { | |
console.log(event); | |
}); | |
a.textContent = "click me"; // これがないとIE10でイベント発火しない | |
var evt = document.createEvent('MouseEvents'); | |
evt.initEvent("click", true, true); | |
a.dispatchEvent(evt); | |
console.log(evt); |
// クライアント側 | |
var ws = io(); | |
// 色々初期化処理 | |
post(data).then(function(response) { | |
doSomethingWith(response); | |
}); | |
function post(data) { | |
return new Promise(function(resolve, reject) { | |
ws.emit("post", data, resolve); |
"use strict"; | |
// push source | |
var timeStream = { | |
start: function(controller) { | |
setInterval(function() { | |
controller.enqueue(new Date()); | |
}, 1000); | |
} | |
}; |