Skip to content

Instantly share code, notes, and snippets.

View buzztaiki's full-sized avatar

Taiki Sugawara buzztaiki

View GitHub Profile
;;; elmo-alias.el --- Alias Folder Interface for ELMO.
;; Copyright (C) 2008 Taiki SUGAWARA
;; Author: Taiki SUGAWARA <buzz.taiki@gmail.com>
;; Keywords: mail, net news
;; This file 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 2, or (at your option)
(defun wl-highlight-message-reverse-citation ()
"Highlight citation prefix only, and unhighlight those messages."
(goto-char (point-min))
(while (not (eobp))
(goto-char (or (next-single-property-change (point) 'face) (point-max)))
(let ((face (get-text-property (point) 'face)))
(when (memq face wl-highlight-citation-face-list)
(put-text-property (point) (save-excursion (forward-line) (point)) 'face nil)
(put-text-property (line-beginning-position) (point) 'face face)
(forward-line)))))
;; htmlize.el -- Convert buffer text and decorations to HTML.
;; Copyright (C) 1997,1998,1999,2000,2001,2002,2003,2005,2006 Hrvoje Niksic
;; Author: Hrvoje Niksic <hniksic@xemacs.org>
;; Modified by : Taiki SUGAWARA <buzz.taiki@gmail.com>
;; Keywords: hypermedia, extensions
;; 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
;;; anything-tags.el --- Yet another etags interface with anything.
;; Copyright (C) 2009 Taiki SUGAWARA
;; Author: Taiki SUGAWARA <buzz.taiki@gmail.com>
;; Keywords: anything, etags
;; 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
@buzztaiki
buzztaiki / countdown.el
Created December 29, 2010 11:50
Countdown to 2011 in Emacs.
(require 'deferred)
(require 'popup)
(defvar countdown-started nil)
(defvar countdown-wait 1000)
(defstruct countdown-tip buffer tip)
(defun countdown-start ()
"Start countdown to 2011."
(interactive)
(require 'anything-match-plugin)
(require 'cl)
(defvar amp-glob-rules
'(;; escape
("\\\\\\(.\\)" . (lambda () (match-string 1)))
;; "[a-z]"
("\\[[^\\]+\\]" . (lambda () (match-string 0)))
;; "{txt,c,h}"
("{\\([^}]+\\)}" . (lambda ()
@buzztaiki
buzztaiki / PermDetail.java
Created September 29, 2011 17:25
print permgen details
import java.util.*;
import java.io.*;
import sun.jvm.hotspot.debugger.*;
import sun.jvm.hotspot.memory.*;
import sun.jvm.hotspot.oops.*;
import sun.jvm.hotspot.runtime.*;
import sun.jvm.hotspot.tools.*;
import sun.jvm.hotspot.utilities.*;
@buzztaiki
buzztaiki / gist:1357754
Created November 11, 2011 11:06
emacs+python夢のコラボ
;; ex. M-x atnd-list-events google
(require 'pymacs)
(defun pymacs-send (pyobj method &rest args)
(apply (pymacs-call "getattr" pyobj method) args))
(pymacs-load "urllib" "pyurllib-")
(defun atnd-json (keyword)
(let ((url (format "http://api.atnd.org/events/?keyword=%s&format=json" keyword)))
@buzztaiki
buzztaiki / gvfs-ls-automount.bash
Created November 21, 2011 18:36
自動マウントするgvfs-ls
#!/bin/bash
tmp=$(mktemp)
/usr/bin/gvfs-ls "$@" 2> $tmp
cat $tmp | grep -e '^Error' && \
/usr/bin/gvfs-mount $(eval "echo \${$#}") && \
/usr/bin/gvfs-ls "$@"
rm $tmp
@buzztaiki
buzztaiki / GCMBean.java
Created December 16, 2011 14:12
Print GCMbeans
import java.lang.management.GarbageCollectorMXBean;
import java.lang.management.ManagementFactory;
import java.util.Arrays;
import java.util.List;
// for x in '' -XX:+UseConcMarkSweepGC -XX:+UseParallelGC -XX:+UseParNewGC; do echo opt:$x; java $x GCMBean; done
public class GCMBean {
public static void main(String[] args) throws Exception {
List<GarbageCollectorMXBean> gcbeans = ManagementFactory.getGarbageCollectorMXBeans();
// printGCBeans(gcbeans);