Skip to content

Instantly share code, notes, and snippets.

😇
nemui

Eitaro Fukamachi fukamachi

😇
nemui
Block or report user

Report or block fukamachi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@fukamachi
fukamachi / ccl
Created Jun 23, 2011
Clozure CL launcher script
View ccl
#!/bin/sh
#
# Change the definition of CCL_DEFAULT_DIRECTORY below to refer to
# your Clozure CL installation directory. The lisp will use this
# environment variable to set up translations for the CCL: logical
# host.
# Any definition of CCL_DEFAULT_DIRECTORY already present in the
# environment takes precedence over definition made below.
@fukamachi
fukamachi / seminar2019.md
Last active Aug 24, 2019
Common Lisp Seminar 2019 ログ by fukamachi
View seminar2019.md

Common Lisp Seminar 2019

2019/08/24 本町オープンソースラボ(大阪府大阪市中央区瓦町3-4-9) https://tcool.connpass.com/event/117789/

@fukamachi が聴いた質問をまとめました。

Q. 自分のプロジェクトを .roswell/local-projects 置くのは一般的なのか?

@fukamachi
fukamachi / common-lisp-scripting-with-roswell.md
Last active Aug 15, 2019
Common Lisp Scripting with Roswell (Draft)
View common-lisp-scripting-with-roswell.md

Common Lisp Scripting with Roswell

"Roswell Script" is implementation-independent Common Lisp scripting program which uses Roswell. Although Roswell itself is a unified interface to Common Lisp implementations, it also encourages writing scripts with it.

To start writing it, run ros init in your terminal:

$ ros init
Usage: ros init [template] name [options...]
@fukamachi
fukamachi / using-travis-ci-with-roswell.md
Last active Jun 9, 2019
Using Travis CI with Roswell
View using-travis-ci-with-roswell.md

Using Travis CI with Roswell

Travis CI is the most prevalent cloud CI service. Though it has no Common Lisp support officially, by using Roswell, you can test your Common Lisp product with a few efforts.

WARNING: This document is based on Roswell v0.0.3.42 (not released yet) or above.

Enabling Travis CI

To use Travis CI, you must sign up and enable testing for your repository at your profile page.

@fukamachi
fukamachi / gist:6364983
Last active May 1, 2019
A Common Lisp function to extract a tarball (.tar.gz) file to a directory (*default-pathname-defaults*).
View gist:6364983
(ql:quickload '(chipz archive))
(defun extract-tarball (pathname)
"Extract a tarball (.tar.gz) file to a directory (*default-pathname-defaults*)."
(with-open-file (tarball-stream pathname
:direction :input
:element-type '(unsigned-byte 8))
(archive::extract-files-from-archive
(archive:open-archive 'archive:tar-archive
(chipz:make-decompressing-stream 'chipz:gzip tarball-stream)
View quicklisp-badges.markdown

Quicklisp badge

Quickdocs.org now provides project badges for Quicklisp projects. It shows Quicklisp dist version when the project was updated last.

Once the project owner adds this badge to their README file, it will inform the project is ready for Quicklisp and its documentation is available on Quickdocs.org.

Stability

It's available, however it was just added in this morning at whim and it may still have issues. Please try it and tell @nitro_idiot if you encountered any issues.

@fukamachi
fukamachi / hoge.asd
Created Feb 18, 2019
ASDF package-inferred-system sample with :pathname
View hoge.asd
(defsystem "hoge"
:class :package-inferred-system
:pathname "src"
:depends-on ("hoge/main")
:in-order-to ((test-op (test-op "hoge/tests"))))
(defsystem "hoge/tests"
:pathname "tests"
:depends-on ("hoge")
:components
View upload-test.lisp
(ql:quickload '(:clack :http-body))
(defvar *handler*)
(setf *handler*
(clack:clackup (lambda (env)
(if (eq (getf env :request-method) :get)
'(200 (:content-type :text-html)
("<html><head></head><body><form method='post' enctype='multipart/form-data'><input type='file' name='upload'><input type='submit' value='Upload'></form></body></html>"))
`(200 () (,(prin1-to-string (http-body:parse (getf env :content-type) (getf env :content-length) (getf env :raw-body)))))))
@fukamachi
fukamachi / keys.lisp
Created Aug 17, 2018
Generating RSA key pairs in DER format
View keys.lisp
(in-package :cl-user)
(ql:quickload '(:ironclad :asn1))
(defun generate-rsa-key-pair (num-bits)
"Same as (ironclad:generate-key-pair :rsa :num-bits num-bits) except returning in DER format."
(check-type num-bits integer)
(let ((l (floor num-bits 2)))
(multiple-value-bind (p q n)
(loop for a = (ironclad:generate-prime (- num-bits l))
@fukamachi
fukamachi / fntype-annot.lisp
Created Jun 24, 2018
Type annotation for functions in Common Lisp
View fntype-annot.lisp
(annot:defannotation fntype (args result form)
(:arity 3)
(let* ((last-form (cl-annot.util:progn-form-last form))
(symbol (cl-annot.util:definition-form-symbol last-form)))
`(progn (declaim (ftype (function ,args ,result) ,symbol))
,form)))
;; Usage:
;; (ql:quickload :cl-syntax)
;; (syntax:use-syntax :annot)
You can’t perform that action at this time.