Skip to content

Instantly share code, notes, and snippets.

View te223's full-sized avatar

Tetsu Takaishi te223

View GitHub Profile
@te223
te223 / myemp-aux.el
Last active December 28, 2023 19:10
EMP版 MacOS emacs29 において、モードライン左端にIMEの状態を示す「あ」などの文字を表示するスクリプト (https://tezfm.blogspot.com/2023/12/emp-emacs291-elisp.html)
;;; -*- coding: utf-8; lexical-binding: t; -*-
;; Copyright (c) 2023 Tetsu. All rights reserved.
;; Created: Fri Dec 8 2023
;; EMP版 emacs29.1 において、モードライン左端にIMEの状態を示す「あ」な
;; どの文字を表示するスクリプト
;;
;; emacs.el または .emacs.d/init.el への組み込み例
;; (when (fboundp 'mac-input-source)
;; ;; (mac-auto-ascii-mode 1) ;; C-xなどで自動で ASCII 入力
@te223
te223 / jzgrep.py
Last active December 28, 2023 19:10
jzgrep.py is a grep-like command-line utility. It can search recursively in compressed archives such as zip and tar.gz .
#!/usr/bin/env python
# -*- coding: utf-8 -*-
r'''
jzgrep.py is a grep-like command-line utility.
It can search recursively in compressed archives such as zip and tar.gz .
And, supports various Japanese encodings.
Requirements: python2.6 or newer - not including python3.
For more info: $ python jzgrep.py --help | less
'''
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# AozoraEpub3 + kindlegen で作成した mobi テキストで、部分的に辞書が
# 引けなくなる時の対策スクリプト。
#
# epub の 本文 xhtml (0001.xhtmlなど)について、句読点の後に、おそらく
# 無害であろうと思われる、空の <span /> タグを挿入している。
# 但し、句読点の後が、ascii文字(white-space, <ruby>タグなど)だった場合は、
# <span/>の挿入は行わない。
@te223
te223 / bindao.py
Last active December 27, 2015 08:29
#!/usr/bin/env python
# -*- coding: utf-8 -*-
r'''
青空文庫のテキストファイルを結合するためのpython スクリプト。
python > 2.7 が必要。 python3 では動きません。
使い方は、$ python bindao.py -h 及び、 $ python bindao.py -H
'''
import sys, os, re
import zipfile, tempfile