Skip to content

Instantly share code, notes, and snippets.

@valvallow
valvallow / reminder2.bat
Last active December 15, 2015 08:59
reminder2
@ECHO OFF
ECHO --------------------------------------------
ECHO 指定時刻にメッセージを表示します
ECHO --------------------------------------------
SET /p MESSAGE_TEXT="メッセージを入力して下さい > "
SET /p START_TIME="時刻を指定して下さい(ex. 09:15) > "
SET TIME2=%time: =0%
@valvallow
valvallow / evolution.scm
Last active December 15, 2015 07:49
Land of Lisp : Chapter 10
#!/usr/local/bin/gosh
;;; 本とshiroさんのコードを写経しつつ少し改造してあります。
;;; https://github.com/shirok/Gauche-LoL/blob/master/evolution.scm
;;; https://github.com/shirok/Gauche-LoL/blob/master/evolution-color.scm
(use srfi-1) ; list-tabulate
(use srfi-27) ; random-integer
(use gauche.parameter)
(use gauche.record)
@valvallow
valvallow / termrandbgcolor.scm
Last active December 15, 2015 07:09
terminal一杯にランダムに背景色をセットし続けるtputのサンプル
#!/usr/local/bin/gosh
(use gauche.process)
(use math.mt-random)
(define (main args)
(define rand
(let1 m (make <mersenne-twister> :seed (sys-time))
(^n (mt-random-integer m n))))
(define (get-tput-val . args)
cat temp/kuromadousi.dat | gosh -u srfi-13 -e '(for-each(^s(string-for-each(^c(display(if(eq? #\space c)" "#`",(string #\\escape)[4,|c|m ,(string #\\escape)[0m")))s)(print))(port->list read-line(standard-input-port))))'
@valvallow
valvallow / 4.txt
Last active December 15, 2015 04:59
FF5
             
                                                              
@valvallow
valvallow / batz.dat
Last active April 29, 2023 15:01
drawing in terminal
0 00 0000000
01011011111110
010111111111000
0111111111111110
011111111111100
01113113111111110
0101310011111110
00100031133100
@valvallow
valvallow / ns.scm
Created March 20, 2013 03:48
number->string
#!/usr/local/bin/gosh
(use gauche.parseopt)
(define (usage cmd)
(print "usage: " cmd " [option ...] number ...")
(print " " cmd " -r [option ...] number [obase ...]")
(print " options:")
(print " r|rest-to-obase : rest args to obase")
(print " i|ibase : input base (default 10)")
@valvallow
valvallow / baroque.scm
Last active December 14, 2015 03:09 — forked from ayato-p/baroque.scm
コマンドにしてみた。
#!/usr/bin/gosh
;; baroque
(use gauche.parseopt)
(use srfi-1) ; circular-list
;;
;; solver
;;
#!/bin/sh
FROM_ADDR='from@mail.com'
TO_ADDR='to@mail.com'
SUBJECT='subject'
MESSAGE=''
if [ $# -eq 0 ] ; then
read MESSAGE
@valvallow
valvallow / reminder.bat
Created October 5, 2012 00:37
reminder
@ECHO --------------------------------------------
@ECHO 指定秒後にメッセージを表示します
@ECHO --------------------------------------------
@SET /p MESSAGE_TEXT="メッセージを入力して下さい > "
@SET /p SLEEP_SECONDS="待機秒数を指定して下さい > "
@TIMEOUT /T %SLEEP_SECONDS% /NOBREAK
@MSG console %MESSAGE_TEXT%