Skip to content

Instantly share code, notes, and snippets.

@kiwanami
kiwanami / calfw-howm-workaround1.el
Created May 27, 2012 04:11
calfw-howm-workaround1.el
(defun cfw:howm-schedule-parse-line (line)
"[internal] Parse the given string and return a result list, (date num type summary)."
(when (string-match "^\\[\\([^@!]+\\)\\]\\([@!]\\)\\([0-9]*\\) \\(.*\\)$" line)
(list
(match-string 1 line)
(or (and (match-string 3 line)
(string-to-number (match-string 3 line))) 0)
(match-string 2 line) (match-string 4 line))))
@kiwanami
kiwanami / e2wm-direx-plugin.el
Created March 8, 2012 03:05
e2wm plugin for direx file list
;;; direx plugin
(require 'direx)
(require 'direx-project)
(setq direx:leaf-icon " "
direx:open-icon "▾ "
direx:closed-icon "▸ ")
(defun e2wm:def-plugin-direx (frame wm winfo)
(let* ((buf (e2wm:history-get-main-buffer))
@kiwanami
kiwanami / init-edbi-for-activeperl.el
Created March 7, 2012 01:05
Emacs DBI setting for ActivePerl
;; Emacs DBI setting for ActivePerl
(require 'edbi)
(setq edbi:driver-info (list "\\Perl\\bin\\perl"
(expand-file-name
"edbi-bridge.pl"
edbi:driver-libpath)))
@kiwanami
kiwanami / e2wm-edbi-pre.el
Created February 16, 2012 07:27
e2wm perspective for edbi
(require 'edbi)
;;; edbi / DB perspective
;;;--------------------------------------------------
(defvar e2wm:c-edbi-recipe
'(| (:left-max-size 40) database
(- (:upper-size-ratio 0.3)
editor result)))
@kiwanami
kiwanami / decompjp.el
Created January 12, 2012 15:34
Emacsで日本語逆変換
;;; decompjp.el --- decompose Japanese text.
;; Copyright (C) 2011 SAKURAI Masashi
;; Author: SAKURAI Masashi <m.sakurai at kiwanami.net>
;; Keywords: languages, tools
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
@kiwanami
kiwanami / gentoo-trans-diff.rb
Created December 18, 2011 08:50
Gentoo翻訳まとめページ生成
#!/usr/bin/ruby
# -*- coding: utf-8 -*-
# cvs diff -u -D20111001 -D20111101 -N . 2>/dev/null|egrep 'Index|version|date'
BASE_URL = 'http://www.gentoo.org/doc/ja/'
class Document
@kiwanami
kiwanami / anything-orgcard.el
Created November 7, 2011 14:06
anything-orgcard.el
;;; anything-orgcard.el --- browse the orgcard by anything
;; Copyright (C) 2011
;; Author: <m.sakurai at kiwanami.net>
;; Keywords: anything, org
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
@kiwanami
kiwanami / cfw-koyomi-source.el
Created November 7, 2011 12:48
cfw-koyomi-source.el
(defvar cfw:koyomi-source
(make-cfw:source
:name "六曜"
:data
(lambda (b e)
(mapcar
(lambda (date)
(cons date (nth 3 (暦-旧暦 (calendar-absolute-from-gregorian date)))))
(cfw:enumerate-days b e)))))
@kiwanami
kiwanami / e2wm-dp-two-popup.el
Created November 1, 2011 16:10
e2wm-dp-two-popup.el for org-open-at-point
(defun e2wm:dp-two-popup (buf)
(e2wm:message "#DP TWO popup : %s" buf)
(let ((buf-name (buffer-name buf))
(is-right?
(eql (selected-window)
(wlf:get-window (e2wm:pst-get-wm) 'right))))
(cond
((memq this-command '(org-open-at-point org-open-at-mouse))
(cond
(current-prefix-arg
@kiwanami
kiwanami / e2wm-format-byte-unit.el
Created October 25, 2011 05:03
e2wm:def-plugin-files-update-buffer.el
(defun e2wm:format-byte-unit (size)
(cond ((null size) "NA")
((> size (* 1048576 4))
(format "%s Mb" (e2wm:num (round (/ size 1048576)))))
((> size (* 1024 4))
(format "%s Kb" (e2wm:num (round (/ size 1024)))))
(t
(format "%s bytes" (e2wm:num size)))))