Skip to content

Instantly share code, notes, and snippets.

(defun split-method-call (str)
(let* ((strs (coerce (jcall "split" str "/") 'list))
(method (car (last strs)))
(class (format nil "~{~A~^/~}" (butlast strs))))
(list class method)))
(defun static-field-p (str)
(destructuring-bind (class field)
(split-method-call str)
(and (not (string= "" class))
(require 'cl)
(defgroup popup-forward-backward nil
"Minor mode for popping up lines which surround forward/backward point")
(defcustom popup-forward-backward:idle-delay 5
"Number of seconds of idle time to wait before popping up"
:type 'number
:group 'popup-forward-backward)
(require 'cl)
(defvar popup-matching-paren-open-parens "([{\"")
(defvar popup-matching-paren-close-parens ")]}\"")
(defun popup-matching-paren (&optional lines)
"popup 1+`lines'*2 lines"
(interactive)
(unless lines
(setq lines 0))
;;; -*- coding:utf-8 mode:emacs-lisp -*-
;;; helm-eshell-dirstack.el
(eval-when-compile (require 'cl))
(require 'helm)
(require 'eshell)
(defun helm-eshell-dirstack-popd (n)
(eshell/popd (format "+%d" n))
(eshell-begin-on-new-line)

Gnupack設定

プロキシ

config.iniファイルを編集する

apt-cyg

apt-cyg -m http://ftp.iij.ad.jp/pub/sygwin/ update
apt-cyg update
# Octaveでチャープ信号を書く
# E(t) = E0 cos(2πfct + at^2)
# t: 時間変化
# E0: 振幅
# fc: 中心周波数
# a: チャープ定数 (a/π: チャープ率)
function fn = mkchirp(E0, fc, a)
fn = @(t) E0 * cos(2 * pi * fc * t + a * power(t, 2));
endfunction;

Mavenのローカルレポジトリにjarファイルを追加する

JavaFXのjarファイルをローカルのMavenレポジトリに追加してみます。

mvn install:install-file -DgroupId=local.oracle -DartifactId=javafxrt -Dversion=x.y.z -Dpackaging=jar -Dfile=/usr/lib/jvm/jdk1.7.0/jre/lib/jfxrt.jar

leiningenのdependenciesに以下を追加すればjfxrt.jarを使えます。

Markdownプロセッサ PegDown

JavaのMarkdown処理ライブラリ、PegDownを使ってみます。

;; leiningen :depencencies
[org.pegdown/pegdown "1.2.0"]

コンストラクタの引数に拡張機能を表すオプションを指定できます。

@kurohuku
kurohuku / dasm.lisp
Created June 13, 2012 14:53
common lisp library wrapping libdasm
(asdf:load-system :cffi)
(defpackage :dasm
(:export
;; type
dword
;; constant
__LIBDASM_VERSION__
GET_VERSION_MAJOR
GET_VERSION_MINOR1
@kurohuku
kurohuku / yas-elargs.el
Created December 7, 2011 16:07
yas-elargs.el
(eval-when-compile (require 'cl))
(require 'yasnippet)
(require 'easy-mmode)
(defvar *yas-elargs/active* nil)
(define-minor-mode yas-elargs-mode
"emacs lisp snippet auto generation mode"
:init-value nil