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
View chasen.rb
require "formula"
class Chasen < Formula
homepage "http://chasen-legacy.osdn.jp"
url "http://iij.dl.osdn.jp/chasen-legacy/56305/chasen-2.4.5.tar.gz"
sha256 "fd1a7afd73ed14e18b0fe82965c00a6baae383070360a4220fde01338611416a"
head "git://git.osdn.jp/gitroot/chasen-legacy/chasen.git"
def install
@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.

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 / which.lisp
Created Jul 4, 2015
which -- check if a command is available on the working environment
View which.lisp
(defun which (command)
(handler-case
(let* ((result (with-output-to-string (s)
(uiop:run-program `("which" ,command)
:output s
:error-output *error-output*)))
(newline-pos
(position-if (lambda (char)
(or (char= char #\Newline)
(char= char #\Return)))
@fukamachi
fukamachi / clhs.ros
Last active Jan 21, 2018
A Roswell script for opening HyperSpec page describing a given symbol in the default browser.
View clhs.ros
#!/bin/sh
#|-*- mode:lisp -*-|#
#|
exec ros -Q -- $0 "$@"
|#
#|
A Roswell script to open the HyperSpec page of a specified symbol in the default browser.
View 00-error.log
$ ros starter.ros
While evaluating the form starting at line 127, column 0
of #P"/usr/local/share/common-lisp/source/roswell/init.lisp":
Unhandled SB-INT:C-STRING-DECODING-ERROR in thread #<SB-THREAD:THREAD
"main thread" RUNNING
{1002D77563}>:
:UTF-8 c-string decoding error:
the octet sequence #(200 23) cannot be decoded.
Backtrace for: #<SB-THREAD:THREAD "main thread" RUNNING {1002D77563}>
@fukamachi
fukamachi / Dockerfile
Created Jun 16, 2015
Dockerfile for building an image of Ubuntu with Roswell
View Dockerfile
FROM ubuntu
MAINTAINER Eitaro Fukamachi <e.arrows@gmail.com>
LABEL Description="Ubuntu with Roswell, Common Lisp implementation manager"
RUN apt-get update && apt-get install -y autotools-dev automake libcurl4-gnutls-dev curl make
RUN curl -SL https://github.com/snmsts/roswell/archive/release.tar.gz \
| tar -xzC /tmp/ \
&& cd /tmp/roswell-release \
&& sh bootstrap \
@fukamachi
fukamachi / 00-vector-case.lisp
Last active Aug 29, 2015
A fast sequence matching macro
View 00-vector-case.lisp
(ql:quickload :alexandria)
(import '(alexandria:ensure-cons alexandria:once-only))
(defmacro vector-case (vec-and-options &body cases)
(destructuring-bind (vec &key (start 0) end case-insensitive)
(ensure-cons vec-and-options)
(let ((otherwise (gensym "otherwise")))
(labels ((case-candidates (el)
(if (and case-insensitive
(characterp el))
View a.cl
; $ sbcl --load a.cl --eval '(sb-ext:save-lisp-and-die "a.out" :toplevel #'\''main :executable t)' && time ( echo 100000000 | ./a.out > /dev/null )
; ( echo 100000000 | ./a.out > /dev/null; ) 10.75s user 0.15s system 99% cpu 10.931 total
; $ sbcl --version
; SBCL 1.2.6
(defun main ()
(declare (optimize (speed 3) (debug 0) (safety 0) (compilation-speed 0)))
(let* ((n (1+ (the fixnum (read))))
(is-prime (make-array n :element-type 'boolean :initial-element t)))
You can’t perform that action at this time.