Skip to content

Instantly share code, notes, and snippets.

@glider-gun
glider-gun / watch.ros
Last active November 28, 2016 02:02
mock watch command (because OS X's original watch command can't display Japanese chars...)
#!/bin/sh
#|-*- mode:lisp -*-|#
#|
exec ros -Q -- $0 "$@"
|#
;; $ watch -n 10 date
;; $ ./watch.ros 10 date
(ql:quickload '(:cl-charms :external-program) :silent t)
@glider-gun
glider-gun / make-sbql.sh
Last active December 30, 2022 03:35
dump sbcl core with quicklisp (and some packages) preloaded (this is created before I use roswell)
#!/bin/sh
OUTPUT="sbql"
PRELOADS="alexandria cl-ppcre local-time cffi cl-interpol"
PREUSES="split-sequence anaphora iterate"
# sbcl --script <<EOF
sbcl --no-sysinit --no-userinit --noprint <<EOF
;; load quicklisp (from .sbclrc content added when quicklisp installation)
(let ((quicklisp-init (merge-pathnames "quicklisp/setup.lisp"
(user-homedir-pathname))))
@glider-gun
glider-gun / less.ros
Created December 25, 2015 18:34
ncursesライブラリバインディングのcl-charmsを使って less コマンドのようなものを作ってみる
#!/bin/sh
#|-*- mode:lisp -*-|#
#|
exec ros -Q -- $0 "$@"
|#
(ql:quickload :cl-charms :silent t)
(defun read-file (fname)
"return lines in fname"
(with-open-file (s fname)
@glider-gun
glider-gun / life.ros
Created March 25, 2016 23:01
simple lifegame on terminal
#!/bin/sh
#|-*- mode:lisp -*-|#
#|
exec ros -Q -- $0 "$@"
|#
(ql:quickload :cl-charms :silent t)
(defpackage :ros.script.life.3667932619
(:use :cl :charms/ll))
(in-package :ros.script.life.3667932619)
@glider-gun
glider-gun / life_braille.ros
Last active April 3, 2016 06:22
Conway's lifegame on terminal, using braille to show dots
#!/bin/sh
#|-*- mode:lisp -*-|#
#|
exec ros -Q -- $0 "$@"
|#
(ql:quickload :cl-charms :silent t)
(defpackage :ros.script.braille_life.3667932619
(:use :cl :charms/ll))
(in-package :ros.script.braille_life.3667932619)
@glider-gun
glider-gun / gray_scott.py
Created October 25, 2018 16:34
gray_scott.py
#!python3
from __future__ import print_function
import numpy as np
try:
from scene import *
ios = True
except:
ios = False
#ios = False