HTMLの文章構造をドーナツチャートで視覚化して、インデントの深さと進捗率を直感的に把握するツールを作ってみました。 スマートフォンでmarkdownを読む時にでもお試しください。
私たちが日々読んでいる文章の多くは、その内容のまとまりをわかりやすく表現するため、
// 対象文字列はerrorCause | |
// 手続き型脳 | |
if (errorCause.isEmpty) { "-" } else { errorCause } | |
// スカラ脳 | |
Option(errorCause).filter(_.nonEmpty).getOrElse("-") |
package controllers.user | |
import controllers.auth.AuthConfigImpl | |
import org.specs2.mutable._ | |
import play.api.test._ | |
import play.api.test.Helpers._ | |
import jp.t2v.lab.play2.auth.test.Helpers._ | |
class UserTest extends Specification { | |
sequential |
// 実際に動かしていないのでタイポがあったら教えてください>< | |
// [Caution] I don't check this code. | |
// GistのスニペットをREPLみたいに実行したいなあ。。(独り言) | |
// I want to execute Gist snipett like REPL from right click only.. | |
class HogeTest extends with BeforeEach with AfterEach with BeforeAll with AfterAll { | |
sequential // DBテストなどの同期処理の時(本題と関係ないけど。。) | |
override protected def before: Any = { | |
println("===== before =====") | |
} |
ruby -e "p [*1..9, *'a'..'z'].sample(12).join" |
git "/usr/local/nvm" do | |
repository "git://github.com/creationix/nvm.git" | |
reference "master" | |
action :sync | |
end | |
template "/etc/profile.d/nvm.sh" do | |
source "nvm.sh.erb" | |
mode 00644 | |
end |
git "/usr/local/rbenv" do | |
repository "git://github.com/sstephenson/rbenv.git" | |
reference "master" | |
action :sync | |
end | |
# 各バージョンのrubyはversions/以下におかれる | |
# 使用中のrubyがshims/以下におかれる | |
%w{/usr/local/rbenv/shims /usr/local/rbenv/versions}.each do |dir| | |
directory dir do |
#!/bin/sh | |
curl -d 'mode=warm&temperature=20&windSpeed=1&power=false' localhost:4567/aircon |
isEmptyObject: function(obj){ | |
if (Object.keys(obj).length === 0) { | |
// or if(!Object.keys(obj).length) | |
return true; | |
} | |
return false; | |
} |