Skip to content

Instantly share code, notes, and snippets.

@miyamuko
miyamuko / gist:5545801
Created May 9, 2013 05:50
サービスごとに異なるパスワードを使い分ける方法 for #xyzzy
;; http://d.hatena.ne.jp/kazuhooku/20130509/1368071543
(defvar *ore-password-length* 12)
(defvar *ore-password-master* nil)
(defun ore-password (domain password)
(let ((pass (delete #\LFD (si:base64-encode (si:hmac-sha-1 password domain :binary t)))))
(if (and *ore-password-length*
(< 0 *ore-password-length*))
(substring pass 0 *ore-password-length*)
@miyamuko
miyamuko / gist:1965967
Created March 3, 2012 13:05
ASDF 2.20 を #xyzzy に移植するのに足りないシンボル
;; このリストの作り方
;;
;; 1. 以下を実行して xyzzy に足りないシンボルに特別な色をつける
;; #xyzzy にはないシンボルと ansify にあるシンボルに色をつけるためのキーワードファイルの生成 — Gist
;; https://gist.github.com/1305799
;; 2. buf2html で HTML に変換
;; 3. 以下の関数で探す
;;
;; (defun find-missing-function ()
;; (set-buffer (find-buffer "*buf2html: HTML*"))
;; * src : fix ole-method.
;; ole-method で文字列を渡すと余計な 0x00 が付く問題
;; via http://fixdap.com/p/xyzzy/8379/
;; via http://d.hatena.ne.jp/miyamuko/20080304/xyzzy_ole_method_bug
;;
;; TODO: 多分これでいいんじゃないかと bowbow99 さんに回答する
(deftest fix-ole-method ()
(flet ((ole-create-file (content)
(let ((tmp (make-temp-file-name)))
@miyamuko
miyamuko / gist:1898750
Created February 24, 2012 07:25
NetInstaller に登録されているアプリのソースをすべて取得 #xyzzy
(require "http-client")
(defvar *package-source-list-url*
"http://xyzzy.s53.xrea.com/wiki/index.php?NetInstaller%2F%C7%DB%C9%DB%A5%D1%A5%C3%A5%B1%A1%BC%A5%B8%B0%EC%CD%F72")
(defvar *package-source-scanner*
(ppcre:create-scanner "<dt>(.+?)(?:\\(.*?\\))</dt>\n<dd><a +href=\"(.+?)\"[^>]*>"
:single-line-mode t
:case-insensitive-mode t))
@miyamuko
miyamuko / gist:1859520
Created February 18, 2012 14:18
Lisp implementation source code

Check out

git clone git://ecls.git.sourceforge.net/gitroot/ecls/ecl
git clone git://sbcl.git.sourceforge.net/gitroot/sbcl/sbcl.git
git clone git://common-lisp.net/projects/cmucl/cmucl.git
hg clone http://clisp.hg.sourceforge.net:8000/hgroot/clisp/clisp
hg clone https://code.google.com/p/mcl/
svn co http://svn.clozure.com/publicsvn/openmcl/trunk/source ccl
svn co http://svn.common-lisp.net/armedbear/trunk/abcl
@miyamuko
miyamuko / xyttr-streaming-api.l
Created February 1, 2012 11:05 — forked from youz/xyttr-streaming-api.l
http-client版、xyttrでstreaming-apiを使用 (とりあえずfilter.jsonのtrackのみ)
;;; -*- mode: lisp; package: xyttr -*-
(eval-when (:compile-toplevel :load-toplevel :execute)
(require "cmu_loop")
(require "json")
(require "http-client")
(require "xyttr")
(use-package :http-client :xyttr))
(in-package :xyttr)
@miyamuko
miyamuko / tweet-with-photo.l
Created January 20, 2012 14:24 — forked from youz/tweet-with-photo.l
http-client版、xyttrで画像アップロード
;;; -*- mode:lisp; package:xyttr -*-
(eval-when (:compile-toplevel :load-toplevel :execute)
(require "oauth")
(require "http-client")
(require "xl-winhttp")
(require "xyttr")
(use-package :http-client :xyttr)
)
@miyamuko
miyamuko / gist:1624211
Created January 17, 2012 02:35
HTML を txt 形式に変換して取得 #xyzzy
(defun response-html-text (res)
(filter-command "w3m -I Shift_JIS -T text/html"
(xhr:xhr-response-text res)
:environ '(("LANG" . "ja_JP"))))
(defun filter-command (command str &key tmp-file-prefix tmp-file-suffix
environ exec-directory)
(let ((in-file (make-temp-file-name tmp-file-prefix tmp-file-suffix))
(out-file (make-temp-file-name tmp-file-prefix tmp-file-suffix)))
(unwind-protect
@miyamuko
miyamuko / xyttr-streaming-api.l
Created January 15, 2012 11:48 — forked from youz/xyttr-streaming-api.l
xl-winhttp版、xyttrでstreaming-apiを使用 (とりあえずfilter.jsonのtrackのみ)
;;; -*- mode: lisp; package: xyttr -*-
(eval-when (:compile-toplevel :load-toplevel :execute)
(require "cmu_loop")
(require "json")
(require "xl-winhttp")
(require "xyttr"))
(in-package :xyttr)
@miyamuko
miyamuko / gist:1550137
Created January 2, 2012 10:06
xl-winhttp の関数生成
(defun to-api (api)
(setf api (substitute-string api "^WinHttp" ""))
(setf api (substitute-string api "[A-Z][a-z]+" "\\0-"))
(setf api (substitute-string api "-$" ""))
(string-downcase api))
(defun gen-winhttp-api ()
(let ((api-list-html (xhr:xhr-get "http://msdn.microsoft.com/en-us/library/windows/desktop/aa384257.aspx"
:key #'xhr:xhr-response-text)))
(with-output-to-temp-buffer ("*tmp*")