Skip to content

Instantly share code, notes, and snippets.

View jidaikobo-shibata's full-sized avatar

jidaikobo-shibata jidaikobo-shibata

View GitHub Profile
@hbsnow
hbsnow / CheckBrowser.class.php
Last active November 14, 2016 02:13
PHPでブラウザを振り分けるクラス。振り分けそのものはそこまで厳密なものではなく、IEをのぞくほとんどのブラウザのユーザは常に最新のブラウザを使用していると想定している。
<?php
/**
* ブラウザをゆるく判別
*
* @version 1.2.2
*/
class CheckBrowser
{
@donghee
donghee / gist:3937661
Created October 23, 2012 08:36
emacs elisp: goto matching parenthesis
(defun jump-match-paren (arg)
"Go to the matching parenthesis."
(interactive "p")
(cond ((looking-at "\\s\(\\|\\s\[") (forward-list 1) (backward-char 1))
((looking-at "\\s\)\\|\\s\]") (forward-char 1) (backward-list 1))
(t (back-to-indentation))
))
(global-set-key [C-return] 'jump-match-paren)
;; http://taiyaki.org/elisp/urlencode/
;; にある urlencode.el のデフォルトをutf-8にして、Emacs3 用に関数を修正
(defvar urlencode-default-coding-system 'utf-8)
;(defvar urlencode-default-coding-system 'sjis)
(defvar urlencode-exceptional-chars "[a-zA-Z0-9]")
(global-set-key "\C-x\C-me" 'urlencode-region)
(global-set-key "\C-x\C-md" 'urldecode-region)
(defmacro with-my-anything-follow-mode (push-mark &rest body)
(declare (indent 1))
(let ((gf (gensym)))
`(letf (((symbol-function 'push-mark)
(symbol-function 'ignore)))
(letf* ((,gf
(symbol-function 'anything-initialize-overlays))
((symbol-function 'anything-initialize-overlays)
(lambda (buffer)
(funcall ,gf buffer)