小嶋 智(こじま さとし)
テキスト処理・ページ記述言語・マークアップ言語の周辺をぐるぐるまわりながら仕事をしつつ、趣味のEPUB制作環境をちまちま作っているエンジニア。 アサガヤデンショ店長、MastodonインスタンスBookwor.ms運営者。
require 'gepub' | |
rendition_layout = GEPUB::Book.parse(File.open('/path/to/epub/file.epub')).rendition_layout | |
if rendition_layout == 'pre-paginated' | |
puts "rendition:layout is #{rendition_layout}, which means fixed layout" | |
else | |
puts "rendition:layout is #{rendition_layout}, which means reflow" | |
end |
git diff --word-diff-regex=$'[^\x80-\xbf][\x80-\xbf]*' --word-diff=color ... |
Containers: 5 | |
Running: 5 | |
Paused: 0 | |
Stopped: 0 | |
Images: 20 | |
Server Version: 17.12.1-ce | |
Storage Driver: devicemapper | |
Pool Name: | |
Pool Blocksize: 65.54kB | |
Base Device Size: 10.74GB |
.latin { | |
font-family: HelveticaNeueLT Std, sans-serif; | |
} | |
.japanese { | |
font-family:'A-OTF 新ゴ Pro',A-OTF Shin Go Pro,sans-serif; | |
} |
body { | |
font-family: HelveticaNeueLT Std, 'A-OTF 新ゴ Pro',A-OTF Shin Go Pro,sans-serif; | |
} |
require 'open-uri' | |
require 'json' | |
require 'nokogiri' | |
require 'uri' | |
raise 'should specify keyword' if ARGV.size < 1 | |
keyword = ARGV[0] | |
title = keyword | |
title = ARGV[1] if ARGV.size >= 2 |
小嶋 智(こじま さとし)
テキスト処理・ページ記述言語・マークアップ言語の周辺をぐるぐるまわりながら仕事をしつつ、趣味のEPUB制作環境をちまちま作っているエンジニア。 アサガヤデンショ店長、MastodonインスタンスBookwor.ms運営者。
pockebell = [%w(わ を ん ゛ °), | |
%w(あ い う え お),%w(か き く け こ),%w(さ し す せ そ), | |
%w(た ち つ て と),%w(な に ぬ ね の),%w(は ひ ふ へ ほ), | |
%w(ま み む め も),%w(や ( ゆ )よ),%w(ら り る れ ろ)] | |
s = ARGV[0].strip.scan(/.{1,2}/).map do |c| | |
a,b = c.split(//) | |
pockebell[a.to_i][b.to_i - 1] | |
end | |
puts s.join |
# on the mastodon server | |
cd /home/mastodon/live | |
git checkout <release tag> | |
docker-compose pull && docker-compose build && docker-compose stop | |
# on the local machine | |
rsync -trzv --delete --rsync-path='sudo rsync' [email protected]:/home/mastodon/live/ backup # get full backup | |
cd backup | |
docker-compose pull && docker-compose build && docker-compose run --rm web rails assets:precompile | |
cd .. |
# Write this in Macro Panel and click on the Run button | |
for myFont in Glyphs.fonts: | |
for ins in myFont.instances: | |
print "Exporting:", ins.familyName | |
ins.generate(Format='TTF',AutoHint=False, RemoveOverlap=False,FontPath='path_to_the_converted_fonts/') |