Skip to content

Instantly share code, notes, and snippets.

@hokupod
hokupod / kazuate.rb
Created August 14, 2021 11:18
数当てゲーム
def incorrect_message(mascot, mess)
puts "\e[93m#{mascot}\e[0m\e[32m < #{mess}\e[0m"
end
answer_count = 0
max_value = ARGV[0].to_i
incorrect_message '(´,,•ω•,,`)◝',
"1 から #{max_value} のあいだで こたえ の すうじ をいれてね"
input = STDIN.gets.to_i
@hokupod
hokupod / file0.pl
Last active February 28, 2018 15:26
正規表現おじさんへの道 ref: https://qiita.com/hokupod/items/84c96122dffa687bfcc8
/(?<=\S)(?![\r\n]) +?$/
@hokupod
hokupod / combine_logfile.rb
Last active December 18, 2015 04:13
`cat *.log > merge.log` で済むものをわざわざRubyで書く。 ref: http://qiita.com/hokupod/items/4cac948084cc1d1884b7
require 'fileutils'
require 'optparse'
require 'securerandom'
# あえてのオープンクラス
class String
# 引数用
def to_multi_pf_arg
windows? ? self.gsub(File::ALT_SEPARATOR) {File::SEPARATOR} : self
end
' アクティブブックの全シート名を取得し、配列で返します。
Public Function SheetNameCollect()
Dim i As Long
Dim SheetCnt As Long
Dim SheetName() As String
SheetCnt = ThisWorkbook.Sheets.Count
ReDim SheetName(0 To SheetCnt - 1)