Skip to content

Instantly share code, notes, and snippets.

View piyo-ko's full-sized avatar

ぴよ (Piyo) piyo-ko

View GitHub Profile
@piyo-ko
piyo-ko / Makefile
Created July 10, 2019 14:02
見開きでスキャンして作られたファイルを、本の1ページがファイルの1ページになるように変換すると、縦持ちのタブレット端末で見やすい
# 毎回見直すべき変数
include config_for_individual_run.mk
#ここからは固定で構わない (はずの) 変数
include common_config.mk
all: $(RESULTANTPDF)
# 所望のページを抜き出し、JPEG画像に変換
$(TEMPORARYDIR)/$(EACHPAGEPREFIX)*.jpg: $(ORIGPDF)
pdfimages -f $(STARTPAGE) -l $(ENDPAGE) -j $(ORIGPDF) $(TEMPORARYDIR)/$(EACHPAGEPREFIX)
@piyo-ko
piyo-ko / Makefile
Created June 14, 2019 12:28
コンパイルした日ではなく LaTeX ソースファイルの最終更新日を表示したい / How do I indicate the last modified date (and time) of multiple LaTeX source files?
all: main.pdf
main.pdf: main.tex data.tex
ls -ltTr main.tex data.tex | perl -ne '@d=split(/ +/); print "\\def\\filelastmodified{$$d[8]年$$d[5]月$$d[6]日 $$d[7]}\n"' > def_filelastmodified.tex
uplatex main.tex && dvipdfmx main.dvi
.PHONY: clean
clean:
rm -f *.log *.aux *.dvi *.pdf def_filelastmodified.tex
@piyo-ko
piyo-ko / Sierpinski_carpet.svg
Last active July 20, 2018 16:44
Nested <g> and <use> elements to draw the Sierpinski carpet
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@piyo-ko
piyo-ko / .docdiff.css
Created September 13, 2017 14:57
Change the style of an HTML file generated by docdiff command, by linking to a predetermined CSS file (~/.docdiff.css).
/*
これは、docdiff で出力される HTML ファイルのスタイルを
カスタマイズするための CSS である。
change_docdiff_style_with_css.pl とあわせて使う。
~/.docdiff.css というパスおよびファイル名は固定。
複数のスタイル指定があったら、後ろのスタイル指定により
前のスタイル指定が上書きされることを利用している。
そのため、
border: none;
@piyo-ko
piyo-ko / change_docdiff_style.pl
Last active September 13, 2017 14:58
Change the style of an HTML file generated by docdiff command
#!/usr/local/bin/perl
# Example usage:
#
# $ docdiff --char old.txt new.txt | ./change_docdiff_style.pl > diff.html
#
use strict;
use warnings;
use utf8;
@piyo-ko
piyo-ko / .bash_profile
Last active December 30, 2016 01:24
settings in .bash_profile for macOS
#lsの表示を好みに合わせる。
alias ls='ls -Fav'
export CLICOLOR=1
export LSCOLORS=dxgxbxexcxBxFxCxExDxBx
#grepの表示も好みに合わせる。
alias grep='grep --color=auto'
#export GREP_COLOR='01;33' #太字で黄色
export GREP_COLOR='38;5;203' #太字なし。256色のうちから色を指定。
#063=ラベンダー、083=萌黄、035=翡翠、203=珊瑚、130=オレンジ