This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SingularToPlural { | |
private SingularToPlural() { | |
} | |
/* | |
・末尾が s, sh, ch, o, x のいずれかである英単語の末尾に es を付ける | |
・末尾が f, fe のいずれかである英単語の末尾の f, fe を除き、末尾に ves を付ける | |
・末尾の1文字が y で、末尾から2文字目が a, i, u, e, o のいずれでもない英単語の末尾の y を除き、末尾に ies を付ける | |
・上のいずれの条件にも当てはまらない英単語の末尾には s を付ける |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Based on http://www.snowelm.com/~t/doc/tips/20030625.ja.html | |
[[ -f ~/.ssh-agent-info ]] && source ~/.ssh-agent-info >/dev/null | |
ssh-add -l >&/dev/null | |
if [ $? == 2 ]; then | |
# unable to contact the authentication agent | |
echo -n "ssh-agent: Restarted..." | |
ssh-agent >~/.ssh-agent-info | |
source ~/.ssh-agent-info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Run: | |
" 1. mkdir tmp | |
" 2. {chrome} --remote-debugging-port=9222 --no-first-run --no-default-browser-check --user-data-dir=tmp | |
" | |
" In another shell: | |
" 1. vim -S client.vim | |
" | |
" ref. https://developer.mozilla.org/ja/docs/Tools/Remote_Debugging/Chrome_Desktop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!a::Send, ^a | |
!b::Send, ^b | |
!c::Send, ^c | |
!d::Send, ^d | |
!e::Send, ^e | |
!f::Send, ^f | |
!g::Send, ^g | |
!h::Send, ^h | |
!i::Send, ^i | |
!j::Send, ^j |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use utf8; | |
use Test::More; | |
sub camelize { | |
my ($s) = @_; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! s:fold(list, f, init) abort | |
let ref = {'result': a:init} | |
return map(copy(a:list), {_,v -> extend(ref, {'result': a:f(ref.result, v)})})[-1].result | |
endfunction | |
function! s:fold2(list, f, init) abort | |
let l = a:list + [a:init] | |
let end = len(a:list) | |
return map(l, {i,v -> i is# end ? l[i-1] : a:f(l[i-1], v)})[-1] | |
endfunction |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
clear | |
echo -n -e "\x1b7" | |
while :; do | |
# 2>/dev/null: hide python stacktrace when Ctrl-C | |
output=$(echo -n -e "あけましておめでとうこざいます。\n本年も日経Linuxとラズパイマガジンをご愛読のほど、\n何卒よろしくお願いいたします。" | boxes -d mouse | lolcat -F 1 -f 2>/dev/null) | |
echo -n -e "\x1b8$output" | |
sleep 0.5s | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! s:run() abort | |
let skkdict = expand('~/Dropbox/config/skkdict/system-dict') | |
" for memory cache | |
call readfile(skkdict) | |
let start = reltime() | |
call readfile(skkdict) | |
let b1 = reltimestr(reltime(start, reltime())) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![feature(slice_patterns)] | |
use std::io; | |
use std::fmt; | |
use std::str; | |
use std::result; | |
use std::iter::Iterator; | |
// TODO: take deparse option from command-line arguments | |
fn main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"io/ioutil" | |
"os" | |
"os/user" | |
"path/filepath" | |
"strings" |