This file contains hidden or 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
// paapi5search.js - Product search using PA-API v5 | |
// by takehikom | |
// npm install paapi5-nodejs-sdk | |
// npm install optparse | |
// npm install bitly | |
// node search.js 'Harry Potter' | |
// node search.js 9784791628889 | |
// node search.js -t 9784393376034 -j |
This file contains hidden or 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 ruby | |
# foureights.rb : "8-((8+8)/8)" Puzzle | |
# by takehikom | |
# see also: https://takehikom.hateblo.jp/entry/2020/01/11/062120 | |
# 環境変数LANGの値がja_JP.UTF-8などのときは, | |
# 日本語文字で出力する(実行時オプションで変更可能) | |
$option_zenkaku = /jp/i === ENV["LANG"] |
This file contains hidden or 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 ruby | |
require "kconv" | |
# iidxum-versionpicker.rb : Version extractor for beatmania IIDX ULTIMATE MOBILE | |
# by takehikom | |
# see also: https://takehikom.hateblo.jp/entry/2019/12/10/000000 | |
# 通信せず、27.0(という名前)のファイルを読み出して、 | |
# game_idの値とバージョン名を見つけ、カンマ区切りで出力する |
This file contains hidden or 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 ruby | |
require "kconv" | |
# iidxum-extractor.rb : Free song extractor for beatmania IIDX ULTIMATE MOBILE | |
# by takehikom | |
# see also: https://takehikom.hateblo.jp/entry/2019/12/10/000000 | |
# beatmania IIDX ULTIMATE MOBILEの楽曲一覧 | |
# (https://p.eagate.573.jp/game/2dx/mobile/music/game.html?game_id=27.0 など) |
This file contains hidden or 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 ruby | |
# dotcircle.rb : Drawing circles connecting four points | |
# by takehikom | |
# This program invokes ImageMagick's "convert" command. | |
class DotcircleDrawer | |
def initialize | |
@bgcolor = "#f0fff0" |
This file contains hidden or 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 ruby | |
# quadrilateral-drawer.rb : Quadrilateral shape decider and drawer | |
# by takehikom | |
# This program invokes ImageMagick's "convert" command. | |
class QuadrilateralDrawer | |
def initialize(opt = {}) | |
@margin = (opt[:margin] || 10).to_i |
This file contains hidden or 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 ruby | |
# waza.rb : 組体操の2冊の本からの技調査 | |
# by takehikom | |
def waza_key(w, indent = 0) | |
" " * indent + w[2] + "(#{w[3]}人技)" | |
end | |
waza2014 = [] |
This file contains hidden or 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 ruby | |
# gf-20190611.rb : ワントップでないピラミッドの荷重計算 | |
# by takehikom | |
# git clone https://github.com/takehiko/gf.git | |
# ruby gf-20190611.rb | |
# gem install rubyXL | |
# ruby gf-20190611.rb -e | |
# ls -l gf1.xlsx gf1a.xlsx gf2.xlsx gf3.xlsx |
This file contains hidden or 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 ruby | |
# kukuniketa.rb : 「九九2桁」ソルバ | |
# by takehikom | |
# [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]といった配列を入力にとり, | |
# 2個ずつ組み合わせて2桁の数を作って,いずれも九九の答えに出現する | |
# ものを求める. | |
# see also: https://takehikom.hateblo.jp/entry/2019/03/11/054444 |
This file contains hidden or 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 ruby | |
# junjo-detector.rb : 「かけ算の順序」(表記ゆれを含む)を見つける | |
# by takehikom | |
# ruby junjo-detector.rb | |
# ruby junjo-detector.rb file ... | |
# ruby junjo-detector.rb directory | |
def find_junjo(io, filename = nil) |