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 | |
module Mail | |
class Message | |
def from_with_patch_rfc_violation | |
str = from_without_patch_rfc_violation | |
begin | |
str = str.join | |
rescue |
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
(define-key emacs-lisp-mode-map (kbd "C-c k") | |
(lambda () | |
(interactive) | |
(insert (format "(kbd \"%s\")" | |
(key-description (read-key-sequence "")))))) |
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
(require 'flymake) | |
(setq flymake-growl-warning-priority 1) | |
(setq flymake-growl-error-priority 2) | |
(setq flymake-growl-warning-sticky t) | |
(setq flymake-growl-error-sticky t) | |
(setq flymake-growl-sticky-list nil) |
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
(arity (symbol-function 'identity)) ;=> (1 . 1) | |
(arity (symbol-function '+)) ;=> (0 . many) | |
(arity (symbol-function 'substring)) ;=> (2 . 3) | |
(defun foo (a b c &optional d e f)) | |
(arity (symbol-function 'foo)) ;=> (3 . 6) | |
(defun bar (a b c &rest rest)) | |
(arity (symbol-function 'bar)) ;=> (3 . many) |
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
1234567890 | |
(defun overlay-test (begin end text color) | |
(let ((o (make-overlay begin end))) | |
(overlay-put o 'window | |
(selected-window)) | |
(overlay-put o 'face | |
`(background-color . ,color)) | |
(overlay-put o 'display text) | |
o)) |
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
(global-hl-line-mode t) | |
(set-face-background 'hl-line "black") |
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
require 'formula' | |
class Ddskk < Formula | |
homepage 'http://openlab.ring.gr.jp/skk/' | |
url 'http://openlab.ring.gr.jp/skk/maintrunk/ddskk-15.1.tar.gz' | |
sha1 'df4e7305c94cb8966e843dff9a0c9f1fabdcb082' | |
depends_on 'emacs' | |
def install |
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
(defun detect-free-key-bindings () | |
(let ((prefix-list '("C-" "C-x " "C-c " "C-x C-" | |
"C-c C-" "M-" "C-M-" "C-x M-" | |
"C-c M-" "C-x C-M-" "C-c C-M-")) | |
(char-list | |
(string-to-char-list | |
(concat "asdfjkl;" | |
"qwertyuiop[]\\zxcvbnm,./" | |
"ASDFGHJKL:\"" | |
"`1234567890-=" |
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
require 'formula' | |
class Gauche <Formula | |
url 'http://prdownloads.sourceforge.net/gauche/Gauche-0.9.tgz' | |
homepage 'http://practical-scheme.net/gauche/' | |
md5 '1ab7e09da8436950989efd55b5dc270a' | |
def install | |
system "./configure", "--disable-debug", "--disable-dependency-tracking", "--prefix=#{prefix}" | |
system "make" |
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
module ControllerMacros | |
def current_user | |
@current_user ||= current_session && current_session.record | |
end | |
def current_session | |
@current_session ||= UserSession.find | |
end | |
def login_as(user) |
NewerOlder