Skip to content

Instantly share code, notes, and snippets.

(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)
;; 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)))
;; 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
;; 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 '())
(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")
@Johniel
Johniel / core.clj
Created April 29, 2012 07:35
lispインタプリタ
;; 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 "=> ")
(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)
@Johniel
Johniel / ytl-linker.el
Created December 6, 2012 07:47
@yutoppはリンカ作成に失敗しました。
(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))
@Johniel
Johniel / tabbar+.el
Created December 18, 2012 01:22
tabbar.el extension
;;; tabbar+.el --- Tabbar extensions
;; Copyright (C) 2012
;; Author:
;; Keywords:
;; Version 0.2.2
;;; Commentary:
@Johniel
Johniel / r.txt
Created March 2, 2013 08:51
reducersをブン回す
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"