Skip to content

Instantly share code, notes, and snippets.

@valvallow
valvallow / batz.dat
Last active April 29, 2023 15:01
drawing in terminal
0 00 0000000
01011011111110
010111111111000
0111111111111110
011111111111100
01113113111111110
0101310011111110
00100031133100
div.section .gist .gist-file .gist-data pre{
font-family: consolas, monospace, sans-serif !important;
-moz-border-radius: 8px;
-moz-border-radius-bottomleft: 0;
-moz-border-radius-bottomright: 0;
-webkit-border-radius: 8px;
-webkit-border-bottom-left-radius: 0;
-webkit-border-bottom-right-radius: 0;
overflow: auto !important;
color: #c2c2c2;
@valvallow
valvallow / csv2sql.scm
Last active April 6, 2022 17:11
convert csv to insert|update sql query string
#!/usr/local/bin/gosh
(use srfi-1)
(use text.csv)
(use file.util)
(use util.list)
(use gauche.parseopt)
(define (usage)
(print "Usage: csv2sql [options ...] <csv-file>")
git config --global alias.his "log --pretty='format:%C(yellow)%h%Creset %C(magenta)%<(22,trunc)%cd%Creset %><(11,trunc)%C(black bold)%ar%Creset | %Cgreen%<(10)%an%Creset | %<(130,trunc)%s %Cred%<(45,trunc)%d%Creset' --date=iso --all -n 15"
@valvallow
valvallow / .stumpwmrc.lisp
Last active December 6, 2019 22:21
.stumpwmrc
(in-package :stumpwm)
;;
;; settings
;;
(set-focus-color "DarkRed")
(set-unfocus-color "black")
(set-win-bg-color "black")
(set-fg-color "white")
(set-bg-color "black")
@valvallow
valvallow / b.sh
Last active March 19, 2019 02:05
seq 0 99 | sed -e 's/.*/□/g' -e "1,$(echo $(date +%j)/3.65 | bc)s/.*/■/g" | tr '\n' ' ' | tr -d ' ';echo $(date +%j)/3.65 | bc | sed -e 's/^/ /g' -e 's/$/%/g'
$ date +%j | awk '{len=int($1/3.65);for(i=0;i<len;i++)printf "%c", "X";printf"\n%d%%",len}'
@valvallow
valvallow / TheSeasonedSchemer.scm
Created February 11, 2010 14:43
The Seasoned Schemer, scramble
;; scramble
; (1 1 1 3 4 2 1 1 9 2) -> (1 1 1 1 1 4 1 1 1 9)
; (1 2 3 4 5 6 7 8 9) -> (1 1 1 1 1 1 1 1 1)
; (1 2 3 1 2 3 4 1 8 2 10) -> (1 1 1 1 1 1 1 1 2 8 2)
(define one?
(lambda (n)
(= n 1)))
@ECHO OFF
REM 今日の日付
SET today=%DATE:~-10,4%%DATE:~-5,2%%DATE:~-2%
REM イベントログコード4800=ログオフ, 4801=ログオンのイベントログを取得
WMIC NTEVENT WHERE "(logfile='security' AND (eventcode='4800' or eventcode='4801') and timegenerated >= '%today%')" GET EventCode,TimeGenerated /FORMAT:CSV > C:\logoff.log\%today%.log
exit
@valvallow
valvallow / year_progress.sh
Last active April 23, 2018 02:27
year progress
seq -w 00 99 | sed -e "1,$(echo "scale=2;" \(\($(date +%s) - $(date -d $(date +%Y)-01-01 +%s)\) / 86400\) / 365 | bc | sed -e 's/^\.//g')s/.*/ /g" -e 's/ /■/g' -e 's/ //g' -e 's/[0-9][0-9]/□/g' | tr '\n' ' ' | sed -e 's/ //g';echo -n ' ';echo "scale=2;" \(\($(date +%s) - $(date -d $(date +%Y)-01-01 +%s)\) / 86400\) / 365 | bc | sed -e 's/^\.//g' -e 's/$/%/g'