This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; for widen-window.el | |
(defun ewm:fix-widen-window-pre-start () | |
;; widen-window でエラーを起きないようする | |
(defadvice wlf:layout-internal (around disable-ww-mode activate) | |
(ad-deactivate-regexp "widen-window") | |
(unwind-protect | |
ad-do-it | |
(ad-activate-regexp "widen-window"))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
from django.utils.text import compress_string | |
from django.utils.cache import patch_vary_headers | |
from django import http | |
try: | |
import settings | |
XS_SHARING_ALLOWED_ORIGINS = settings.XS_SHARING_ALLOWED_ORIGINS |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Automatically add, commit, and push when files change. | |
(defvar autocommit-dir-set '() | |
"Set of directories for which there is a pending timer job") | |
(defun autocommit-schedule-commit (dn) | |
"Schedule an autocommit (and push) if one is not already scheduled for the given dir." | |
(if (null (member dn autocommit-dir-set)) | |
(progn | |
(run-with-idle-timer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*quickrun.txt* コマンドを素早く実行します。 | |
Version: 0.4.1 | |
Author : thinca <[email protected]> | |
License: クリエイティブ・コモンズの表示 2.1 日本ライセンス | |
<http://creativecommons.org/licenses/by/2.1/jp/> | |
============================================================================== | |
目次 *quickrun-contents* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; This makes ido-find-file-other-window, | |
;; ido-switch-buffer-other-window, et. al obsolete. It’s a much better | |
;; abstraction, and I believe it should become apart of ido mode, | |
;; because any command that uses ido-completing-read can benefit from | |
;; it without any additional effort, including textmate.el’s | |
;; textmate-goto-symbol. | |
(require 'ido) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# tested against python-libmemcached 0.17 and kumofs-0.4.10 | |
# http://pypi.python.org/pypi/python-libmemcached/0.17.0 | |
from cmemcached import Client | |
cl = Client(["localhost:11211"], behaviors={'support_cas': 1}) | |
#cl = Client(["localhost:11411"], behaviors={'support_cas': 1}) | |
cl.set('spam', 'SPAM') | |
value = cl.get('spam') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Ruby + htmlfile + JavaScript-XPath で XPath | |
# | |
# Example: | |
# | |
# > ruby htmlfile-xpath.rb http://gist.github.com/gists "//div[@class='info']/span/a" | |
# gist: 497491 | |
# gist: 497481 | |
# gist: 497469 | |
# : | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; xyzzy + htmlfile + JavaScript-XPath で XPath | |
;; | |
;; See: | |
;; http://d.hatena.ne.jp/amachang/20071112/1194856493 | |
;; http://d.hatena.ne.jp/mobitan/20090829/1251542456#20090829f10 | |
(require "xml-http-request") | |
(defparameter *javascript-xpath-uri* | |
"http://svn.coderepos.org/share/lang/javascript/javascript-xpath/trunk/release/javascript-xpath-latest-cmp.js") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; バイトコンパイルあり・なしでのjsonのベンチマーク | |
(require "json") | |
(require "xml-http-request") | |
(defmacro benchmark (&body body) | |
`(let (times result) | |
(dotimes (i 4) | |
(gc t) | |
(message "~[Warm up~:;Round ~:*~A~]" i) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; xyzzy ではてな ID や Twitter のユーザ名をクリックできるようにする clickable-uri の設定 | |
;; | |
;; * clickable-uri | |
;; http://ohkubo.s53.xrea.com/xyzzy/index.html#clickable-uri | |
;; | |
;; * clickable-uriを導入しよう | |
;; http://xyzzy.s53.xrea.com/wiki/index.php?QuickTour/ext/clickable-uri#t8450eec | |
(defun clickable-uri-add-special (prefix id uri-format) | |
(let ((id-regexp (format nil "~A~A" prefix id)) |