Skip to content

Instantly share code, notes, and snippets.

View windymelt's full-sized avatar
😄
Working from Home

Windymelt windymelt

😄
Working from Home
View GitHub Profile
@fukamachi
fukamachi / fntype-annot.lisp
Created June 24, 2018 15:07
Type annotation for functions in Common 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)
@fukamachi
fukamachi / quicklisp-badges.markdown
Last active July 19, 2021 21:26
Quicklisp badge

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.

@tototoshi
tototoshi / echo.scala
Created January 5, 2012 13:31
Scalaでスクリプトとか書くときのコマンドライン引数の解析
#!/bin/sh
exec scala "$0" "$@"
!#
val helpMessage = """
Usage:
-n do not output the trailing newline
-x repeat x times
@yamakk
yamakk / ignoredecodetest.scala
Created December 6, 2011 08:49
ignoredecodetest.scala utf-8でdecodeできないファイルをscalaで扱う
import java.io.{InputStreamReader, FileInputStream, BufferedReader}
import java.nio.charset.{Charset, CharsetDecoder, CodingErrorAction}
/*
通常 Source.fromFile("sample.txt")では
java.nio.charset.MalformedInputException: Input length = 1
エラーが出る場合使う.
*/
object IgnoreDecodeTest{