Skip to content

Instantly share code, notes, and snippets.

View kyanagi's full-sized avatar

Kouhei Yanagita kyanagi

View GitHub Profile
;;; anything
(setq anything-command-map-prefix-key "C-x C-a")
(require 'anything)
;; C-z は C-; で実行できるようにする
(define-key anything-map (kbd "C-;") 'anything-execute-persistent-action)
(define-key anything-map (kbd "M-;") 'anything-execute-persistent-action)
(require 'anything-startup)
(dolist (map (list
anything-map
anything-c-buffer-map
% make test-all
./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext -- --disable-gems "./test/runner.rb" --ruby="./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext -- --disable-gems"
Run options: "--ruby=./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext -- --disable-gems"
# Running tests:
...............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
--- session.el.orig 2012-02-18 12:58:20.000000000 +0900
+++ session.el 2012-02-18 13:07:47.000000000 +0900
@@ -409,6 +409,11 @@
:group 'session-globals
:type 'regexp)
+(defcustom session-globals-exclude-regexp "\\`anything-"
+ "Regexp matching global variables NOT to be saved between sessions."
+ :group 'session-globals
+ :type 'regexp)
if type growlnotify > /dev/null 2>&1
then
GROWL_REPORTTIME=5
COMMAND=
COMMAND_START_TIME=0
function reset_command_start_time {
COMMAND="${1}"
COMMAND_START_TIME=`date +%s`
echo $COMMAND
}
function shogun {
:
}
function _shogun {
local -a _names
_names=(
Ieyasu
Hidetada
@kyanagi
kyanagi / gist:1955722
Created March 2, 2012 04:37
anything-minibuffer-history: replace minibuffer contents
(setcdr (assoc 'action anything-c-source-minibuffer-history)
(lambda (candidate)
(delete-minibuffer-contents)
(insert candidate)))
function bundle-cd {
local output exit_status
output=`bundle show $1`
exit_status=$?
if [ $exit_status -eq 0 ]; then
cd "$output"
else
echo $output 1>&2
return $exit_status
fi
(defun kill-buffer-file-name (nondirectory-p)
(interactive "P")
(let ((file-name (buffer-file-name)))
(if (stringp file-name)
(progn
(when nondirectory-p
(setq file-name (file-name-nondirectory file-name)))
(message "%s" file-name)
(kill-new file-name))
(error "This buffer does not visit a file"))))
require 'active_record'
class Foo < ActiveRecord::Base; end
module Bar
refine Integer do
define_method(:+) { }
end
end
def run
results = []
1.upto(100000) do |i|
results.push(rand(2))
results.shift if results.size == 4
if results.size == 3 && results.uniq.size == 1
return i
end
end