This file contains 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
(setq text nil) | |
(setq buff-name "k7script") | |
(setq timer nil) | |
(setq font nil) | |
(setq adj nil) | |
(load-file "path/to/file") | |
(defun k7:rand-walk (pos) | |
(let (neighbor) |
This file contains 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
;; remove left/right tabs | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
(defun tabbar-tab-index(ctabs ctab) | |
(let ((index 0) | |
(head '()) | |
(rest ctabs)) | |
(while (not (eq ctab (car rest))) | |
(incf index) | |
(setq head (append head (list (car rest)))) | |
(setq rest (cdr rest))) |
This file contains 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
;; tabbar-buffer-group-function | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
(setq tabbar-cycle-scope 'tabs) | |
;; (define-key global-map (kbd "\C-x <up>") 'tabbar-forward-group) | |
;; (define-key global-map (kbd "\C-x <down>") 'tabbar-backward-group) | |
(global-set-key [(C-tab)] 'tabbar-forward-group) | |
(global-set-key [(C-S-tab)] 'tabbar-backward-group) | |
;; Switching Between Two Recently Used Buffers | |
;; http://www.emacswiki.org/emacs/SwitchingBuffers |
This file contains 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
;; move tab position | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
(defun tabbar-insert (tabs ctab nth) | |
(append (nthcar nth tabs) | |
(list ctab) | |
(nthcdr nth tabs))) | |
(defun tabbar-find-remove (ctabs ctab) | |
(let ((index 0) | |
(head '()) |
This file contains 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
(require 'cl) | |
(require 'deferred) | |
(require 'http-get) | |
(require 'xml) | |
(require 'url) | |
(setq aoj-url "http://judge.u-aizu.ac.jp/onlinejudge") | |
(setq aoj-passwd "pass") | |
(setq aoj-id "id") |
This file contains 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
;; mini-lisp interpretor | |
;; org.clojure/clojure 1.3.0 | |
;; org.clojure/clojure-contrib 1.2.0 | |
;; Leiningen 1.6.1 on Java 1.6.0_23 OpenJDK Client VM | |
(ns mini-lisp.core | |
(:use [clojure.inspector :include [atom?]]) | |
(:gen-class)) | |
(def prompt "=> ") |
This file contains 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
(require 'linum) | |
(require 'whitespace) | |
(defface linum-hidden-face '((t :inherit (shadow default))) nil) | |
(set-face-attribute | |
'linum-hidden-face nil | |
:foreground (assoc-default 'background-color default-frame-alist)) | |
(defun ytl-hide-spaces (str) |
This file contains 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
(defun sort-lines-random (beg end) | |
"Sort lines in region randomly." | |
(interactive "r") | |
(save-excursion | |
(save-restriction | |
(narrow-to-region beg end) | |
(goto-char (point-min)) | |
(let ;; To make `end-of-line' and etc. to ignore fields. | |
((inhibit-field-text-motion t)) |
This file contains 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
;;; tabbar+.el --- Tabbar extensions | |
;; Copyright (C) 2012 | |
;; Author: | |
;; Keywords: | |
;; Version 0.2.2 | |
;;; Commentary: |
This file contains 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
user=> (clojure-version) | |
"1.4.0" | |
user=> (require '[clojure.math.numeric-tower :as math]) | |
nil | |
user=> (for [n (range 0 26)] | |
#_=> (let [v (vec (range 0 (math/expt 2 n)))] | |
#_=> (do (System/gc) | |
#_=> (time (reduce + (filter even? (map #(mod % 2) v))))))) | |
("Elapsed time: 0.272565 msecs" |
OlderNewer