Skip to content

Instantly share code, notes, and snippets.

Array.from(document.querySelectorAll('.gameListRowItemName')).map((it) => it.textContent).join("\n")
@anekos
anekos / tally-counter
Created May 6, 2020 11:07
Tally counter (Press ESC to exit)
#!/bin/bash
set -euC
# set -o pipefail
declare -A counts
function result () {
stty "$stty"
for i in "${!counts[@]}"
@anekos
anekos / anekos-longtimeago.zsh
Created June 29, 2010 11:29
シェルで長い処理が終わったときに声で通知する
function _anekos_longtimeago_preexec {
# マッチするコマンドの時は無視する
[[ $2 == (sc|screen|ssh|vim|git ci)\ * ]] && return
_anekos_longtimeago_time=`date +%s`
}
function _anekos_longtimeago_precmd {
[ ${+_anekos_longtimeago_time} = 1 ] || return
@anekos
anekos / kindle-cloud-reader.js
Last active March 8, 2020 19:46
Kindle Cloud Reader Key Mapper for Vimperator
/* NEW BSD LICENSE {{{
Copyright (c) 2014, anekos.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
@anekos
anekos / support-internet-explorer.js
Created March 5, 2020 08:09
Internet Explorer に対応する JavaScript
if (~window.navigator.userAgent.indexOf('Trident')) {
location.href = 'https://getfirefox.com';
}
@anekos
anekos / kakukaku
Created February 23, 2020 14:51
kakukaku
#!/bin/bash
set -euC
# set -o pipefail
# exec 5>> /tmp/xmosh/shell-script-debug.out
# BASH_XTRACEFD="5"
# PS4='$LINENO: '
# set -x
@anekos
anekos / hayai
Last active February 8, 2020 13:33
#!/bin/bash
GLOB='**/*.md *.txt'
set -o noglob
p-args $GLOB
echo ''
set +o noglob
@anekos
anekos / not_works.sh
Created October 1, 2019 10:22
シェルスクリプトでクロージャ(勿論動かない)
function upload () {
local src="$1"
# ...
mv "$temp" "$src"
clean_src () {
rm "$src"
}
trap clean_src EXIT
@anekos
anekos / dont-say.vim
Created May 30, 2019 11:56
Vim で良くない単語を自動で修正するスクリプト
iabbr dog cat