Skip to content

Instantly share code, notes, and snippets.

(ql:quickload '(:cffi :cl-ppcre))
(with-output-to-string (*standard-output*)
(handler-bind
((cffi:load-foreign-library-error
#'(lambda (c)
(declare (ignore c))
(invoke-restart 'cffi::use-value "libncursesw.so.5"))))
(ql:quickload :cl-charms)))
(defun eltstr->sexp (eltstr base-expr)
(loop :with x := base-expr
:with gensym := (gensym)
:for i :in (mapcar #'(lambda (x) (mapcar (lambda (x) (or (= (length x) 0)
(parse-integer x))) (split-sequence:split-sequence #\_ x)))
(split-sequence:split-sequence #\/ eltstr))
:do (setq x (cond ((eql (length i) 1)
(if (minusp (first i))
`(let ((,gensym ,x))
(nth (+ (length ,gensym) ,(first i)) ,gensym))
(defun ymdhms (&optional (universal-time (get-universal-time)))
(or (ignore-errors (format nil "~{~2,'0d~#[~;:~;:~;_~:;/~]~}"
(cdddr (nreverse (multiple-value-list (decode-universal-time universal-time))))))
"not-universaltime"))
@snmsts
snmsts / clack.websocket.lisp
Created August 23, 2014 18:04
websocket test implementation
(ql:quickload '(:clack :cl-async))
(defpackage websocket.test
(:use :cl
:clack))
(in-package :websocket.test)
(defvar *handler*
(clackup
@snmsts
snmsts / roswell.rb
Created October 19, 2014 14:51
homebrew test
require "formula"
class Roswell < Formula
homepage ""
url "https://github.com/snmsts/roswell/archive/v0.0.2.11.tar.gz"
version '0.0.2.11'
sha1 "02154cf0ea908ccc52af0382c730f3f7304c0c1f"
depends_on 'libarchive'
depends_on "autoconf" => :build
$ diff -u -r c\:/Users/Vagrant/.roswell/impls/ALL/ALL/quicklisp/dists/quicklisp/cffi_0.14.0/ c\:/Users/Vagrant/.roswell/impls/ALL/ALL/quicklisp/dists/quicklisp/software/cffi_0.14.0/
diff -u -r c:/Users/Vagrant/.roswell/impls/ALL/ALL/quicklisp/dists/quicklisp/cffi_0.14.0/grovel/grovel.lisp c:/Users/Vagrant/.roswell/impls/ALL/ALL/quicklisp/dists/quicklisp/software/cffi_0.14.0/grovel/grovel.lisp
--- c:/Users/Vagrant/.roswell/impls/ALL/ALL/quicklisp/dists/quicklisp/cffi_0.14.0/grovel/grovel.lisp 2014-09-10 05:06:56.000000000 +0900
+++ c:/Users/Vagrant/.roswell/impls/ALL/ALL/quicklisp/dists/quicklisp/software/cffi_0.14.0/grovel/grovel.lisp 2014-12-29 01:04:07.059990500 +0900
@@ -279,12 +279,13 @@
,@*cc-flags*
;; add the cffi directory to the include path to make common.h visible
,(format nil "-I~A"
- (directory-namestring
+ (namestring
@snmsts
snmsts / hoge.ros
Created January 16, 2015 09:58
example of '+Q' in script.
#!/bin/sh
#|-*- mode:lisp -*-|#
#|
exec ros +Q -- $0 "$@"
|#
(defun main (&rest argv)
(declare (ignorable argv))
#1=(progn (apropos "quick")
(format t "~&----------------------------------~%"))
(ros:quicklisp)
@snmsts
snmsts / hoge.lisp
Created January 25, 2015 15:45
cffi-grovel-test
(ql:quickload :cffi-grovel)
(defparameter *pwd* (make-pathname :name nil :type nil :defaults *load-pathname*))
(defpackage :hoge.ffi)
(with-open-file (out (merge-pathnames "tmp.lisp" *pwd*)
:direction :output
:if-does-not-exist :create
:if-exists :supersede)
(format out "~{~S~%~}" '((in-package :hoge.ffi)
@snmsts
snmsts / test.lisp
Created March 10, 2015 20:00
how to use ros dump executable
$ ros -l test.lisp -E cl-user::main dump executable hoge
To load "clack":
Load 1 ASDF system:
clack
; Loading "clack"
...................
[undoing binding stack and other enclosing state... done]
[saving current Lisp image into hoge:
writing 5824 bytes from the read-only space at 0x20000000
writing 3168 bytes from the static space at 0x20100000
@snmsts
snmsts / gist:740b714893888a7a16a3
Last active August 29, 2015 14:20
directory name survey for roswell
$ pwd
/home/vagrant/.roswell/impls/ALL/ALL/quicklisp/dists/quicklisp/software
$ ls */bin
clack-20150407-git/bin:
clackup
common-lisp-stat-20140826-git/bin:
GetRepos.sh cls.lisp