This file contains 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 "shell3") | |
(in-package "editor") | |
(export '(exec-eshell *eshell-profiles*)) | |
(defparameter *eshell-profiles* | |
`((:name "sbcl" :com "sbcl.bat" :prompt "^\\* ") | |
(:name "clisp" :com "clisp.bat" :prompt "^[\\[0-9\\]+]> ") | |
(:name "gosh" :com "gosh.exe -i" :encoding ,*encoding-utf8n*) | |
(:name "ypsilon" :com "ypsilon.bat") |
This file contains 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
;;; goo.gl url shortener interface for xyzzy | |
(eval-when (:compile-toplevel :load-toplevel :execute) | |
(require 'cmu_loop) | |
(require 'xml-http-request) | |
(require 'json) | |
(unless (find-package :googl) | |
(defpackage :googl | |
(:use :lisp :editor)))) |
This file contains 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
;;; -*- mode: lisp; package: ldrpin -*- | |
;;; ldrpin mode for xyzzy | |
(eval-when (:compile-toplevel :load-toplevel :execute) | |
(require 'xml-http-request) | |
(require 'json) | |
(require 'www/www) | |
(unless (find-package :ldrpin) | |
(defpackage :ldrpin |
This file contains 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 'cmu_loop) | |
(defun expand-short-url (url) | |
(if (not (string-match "http://\\([^/]+\\)/\\(.+\\)" url)) | |
url | |
(let ((host (match-string 1)) | |
(path (match-string 2))) | |
(with-open-stream (cn (connect host 80)) | |
(format cn "GET /~A HTTP/1.1\nHost: ~A\n\n" path host) | |
(let* ((res (read-line cn nil)) | |
(m (string-match "^HTTP/[0-9.]+ \\([0-9]+\\) .+$" res)) |
This file contains 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
;;; for xyzzy | |
(defun sogebu-region (from to &aux (text (buffer-substring from to))) | |
(interactive "r") | |
(with-input-from-string (is "H4sIAHp+TUsAA2t0aCQaKjSXa8Tlx2k2lyvUOXIRrw8GaxpPkKIrDkTqE9ShAHZTYxxhNyk0xmkoNDpowvgYGsAmKfT5w62PU2hsAamJR1gGZMcDlQBFNRrBFoPEm0FqoKJAWxQUuMCam9YqYLEFLAQAGz2QiHgBAAA=") | |
(insert (apply #'format nil (si:inflate-stream (si:base64-decode is)) | |
(split-string (concat text "\n\n\n\n") #\LFD :ignore-empty nil))))) |
This file contains 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
;;; from http://okajima.air-nifty.com/b/2010/01/post-abc6.html | |
(= m (filechars "~/gists/maze_arc/maze.txt") ; or (drain:readc) | |
w (+ 1 (pos #\newline m)) | |
a (n-of len.m nil) | |
(a:pos #\S m) '(0) | |
d 0 | |
route) | |
(until route |
This file contains 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
;;; ref. http://github.com/yhara/ShogiModan | |
(eval-when (:compile-toplevel :load-toplevel :execute) | |
(unless (find-package :modanshogi) | |
(defpackage :modanshogi | |
(:use #+:xyzzy :lisp | |
#-:xyzzy :common-lisp)))) | |
(provide 'modanshogi) |
This file contains 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
;;; http://www.itmedia.co.jp/enterprise/articles/1004/03/news002_2.html | |
#+xyzzy | |
(require 'cmu_loop) | |
;; utils | |
(defmacro aif (test then &optional else) | |
`(let ((it ,test)) (if it ,then ,else))) | |
(defmacro n-of (n expr) |
This file contains 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
;;; ref. http://xyzzy.s53.xrea.com/wiki/index.php?%B4%D8%BF%F4%A4%CE%A5%B0%A5%E9%A5%D5%A4%F2%C9%BD%BC%A8%A4%B9%A4%EB | |
(require "cairo") | |
(use-package :cairo) | |
(defmacro draw-to-png | |
((cr filename &key (width 256) (height 256) (normalize t)) | |
&body body) | |
`(progn | |
(when (file-exist-p ,filename) |
This file contains 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
;;; ref. http://blog.practical-scheme.net/gauche/20100428-shorter-names | |
;;; http://d.hatena.ne.jp/higepon/20100511/1273584001 | |
#+:xyzzy | |
(require 'cmu_loop) | |
(defmacro ^ (args . body) | |
`(lambda ,args ,@body)) | |
(defmacro define-caret-macros (chars) |