convert
(ImageMagick) is required.
$ vi update-shelf (Edit PDFDIR and SHELFDIR)
$ update-shelf
$ erb shelf.erb > index.html
$ open -a safari index.html
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<meta name="description" content=""> | |
<meta name="author" content="結城浩 / Hiroshi Yuki"> | |
<meta name="keywords" content="結城浩,Hiroshi Yuki" > | |
<title>drawicon</title> |
/* | |
* ShowMobileTweet.js | |
* | |
* When you see: | |
* https://twitter.com/hyuki/status/1079981317184315392 | |
* Then jump to: | |
* https://mobile.twitter.com/hyuki/status/1079981317184315392 | |
*/ | |
function start() { |
convert
(ImageMagick) is required.
$ vi update-shelf (Edit PDFDIR and SHELFDIR)
$ update-shelf
$ erb shelf.erb > index.html
$ open -a safari index.html
#!/usr/bin/env ruby | |
# cf. http://bit.ly/2raKfLZ | |
# makeapp - スクリプトをMacのアプリケーションにする | |
if ARGV.length != 2 | |
abort("Usage: makeapp foo.rb Foo.app") | |
end | |
scriptname = ARGV[0] | |
appname = ARGV[1] |
#!/usr/bin/env ruby | |
# cf. http://bit.ly/2raKfLZ | |
# makeopenapp - URLをオープンするだけのスクリプトをMacのアプリケーションにする | |
if ARGV.length != 2 | |
abort("Usage: makeopenapp URL Example.app") | |
end | |
url = ARGV[0] | |
appname = ARGV[1] |
CGI.escapeHTML('< > &') #=> < > &
CGI.escape('< > &') #=> %3C+%3E+%26
URI.encode('< > &') #=> %3C%20%3E%20&
CGI.escapeHTML('https://example.com/') #=> https://example.com/
CGI.escape('https://example.com/') #=> https%3A%2F%2Fexample.com%2F
URI.encode('https://example.com/') #=> https://example.com/
CGI.escapeHTML('結') #=> 結
# 毎日『m段上ってn段下がる』を繰り返したら、 | |
# x日目にd段目に初めて着いた。 | |
# xをd,m,nで表せ。文字はすべて正の整数で、m>nとする。#数学の問題 | |
# https://twitter.com/hyuki/status/1134018952416321536 | |
# current段目から「m段上ってn段下がる」ときに通過する | |
# 「段目」を引数にブロックをyieldして | |
# 最終的な段目を戻り値に | |
def daily(current,m,n) | |
m.times do |
# 毎日『m段上ってn段下がる』を繰り返したら、 | |
# x日目にd段目に初めて着いた。 | |
# xをd,m,nで表せ。文字はすべて正の整数で、m>nとする。#数学の問題 | |
# https://twitter.com/hyuki/status/1134018952416321536 | |
# current段目から「m段上ってn段下がる」ときに通過する | |
# 「段目」を引数にブロックをyieldして | |
# 最終的な段目を戻り値に | |
def daily(current,m,n) | |
m.times do |