Skip to content

Instantly share code, notes, and snippets.

View peccu's full-sized avatar
🦉
Information is the network

peccu peccu

🦉
Information is the network
View GitHub Profile
@Steven-Rose
Steven-Rose / gist:3943830
Created October 24, 2012 04:27
VI: Select all + delete, select all + copy
Select all and delete (actually move to buffer)
:%d
Select all and copy to buffer
:%y
Use p to paste the buffer.
@zonuexe
zonuexe / README.md
Created October 4, 2012 08:44
ShellSclisp

ShellSclisp

How to use

  1. launch terminal, and type bash -i
  2. . ./shellsclisp.sh ( . known as source )
  3. interactive lisp shell!!!
@takeisa
takeisa / gist:3769042
Created September 23, 2012 06:03
Common Lisp format memo
* common-lisp: format:
~a aesthetic
~s readで読める形式
~:a nil → () で出力
~% 改行
~& 先頭でないときに改行
~5% 5個改行
~~ ~を出力
~5~ 5個出力
~c 文字
@Nyoho
Nyoho / urlinfo-safari2org-mode
Created August 27, 2012 06:36
Safari で開いているページのタイトルとURLを org-mode 形式でさくっとコピー
-- Generate a link text in org-mode style and copy it to clipboard
tell application "Safari"
set theTitle to do JavaScript "document.title" in front document
set theURL to URL of front document
end tell
set the clipboard to "[[" & theURL & "][" & theTitle & "]]"
@yoshinari-nomura
yoshinari-nomura / gist:3465571
Created August 25, 2012 13:20
Font setup for Cocoa Emacs24
(when (and (>= emacs-major-version 24)
(eq window-system 'ns))
;; フォントセットを作る
(let* ((fontset-name "myfonts") ; フォントセットの名前
(size 14) ; ASCIIフォントのサイズ [9/10/12/14/15/17/19/20/...]
(asciifont "Menlo") ; ASCIIフォント
(jpfont "Hiragino Maru Gothic ProN") ; 日本語フォント
(font (format "%s-%d:weight=normal:slant=normal" asciifont size))
(fontspec (font-spec :family asciifont))
(jp-fontspec (font-spec :family jpfont))
@nyuichi
nyuichi / monads.scm
Created August 24, 2012 03:04
Monadic Operators in Scheme
;;; Monadic Operators
;;; List Monad
(define (mappend fn . lists)
(apply append (apply map fn lists)))
(define (bind monad . funcs)
(fold mappend monad funcs))
(define unit list)
@sky-y
sky-y / ucs-normalize-NFC-buffer.el
Created August 5, 2012 12:14
Emacs: MacでPDFからコピーすると濁点が分離する問題を直す
;; ucs-normalize-NFC-region で濁点分離を直す
;; M-x ucs-normalize-NFC-buffer または "C-x RET u" で、
;; バッファ全体の濁点分離を直します。
;; 参考:
;; http://d.hatena.ne.jp/nakamura001/20120529/1338305696
;; http://www.sakito.com/2010/05/mac-os-x-normalization.html
(require 'ucs-normalize)
(prefer-coding-system 'utf-8-hfs)
(setq file-name-coding-system 'utf-8-hfs)
/*
@utatakiyoshi: 友達がSkypeで「0~9を1回ずつ使い,?????/?????=1/9となるように?を埋めよ」って算数パズルを出してきたからC++でサクッと書いてドヤ顔してやった
ちなみにこうなった
result: 6381 57429
result: 6471 58239
result: 8361 75249
result: 10638 95742
result: 10647 95823
result: 10836 97524
@leque
leque / gist:2366512
Created April 12, 2012 10:59
行中で最初に現れた括弧と対応する閉じ括弧を(薄く)ハイライトする(編集には未対応)
;;; 行中で最初に現れた括弧と対応する閉じ括弧を(薄く)ハイライトする
;;; (jit-lock-register #'dehighlight-paren)
;;; で動くつもり
(defvar paren-face 'paren-face)
(make-face 'paren-face)
(set-face-foreground 'paren-face "grey90")
(defun dehighlight-paren-1 (pos)
(add-text-properties pos (1+ pos)
@condotti
condotti / my-dump-theme.el
Created March 14, 2012 11:40
color-themeをemacs24のthemeに変換するモノ
(load-library "cl-extra")
(defun my-get-face-attributes (face)
(reverse
(mapcan '(lambda (a)
(let ((v (face-attribute face a)))
(if (not (or (eq a :inherit) (eq v 'unspecified)))
(list v a))))
(mapcar 'car face-attribute-name-alist))))