A quick comparison/ benchmark between Hogan, Dust, doT and underscore
Developed by Twitter (same team as Bootstrap), use exactly the same syntax as Mustache, but more performant and more stuff available server side.
My name is {{ name }}
# Before | |
Rails.application.config.assets.version = '1.0' | |
Rails.application.config.assets.paths << Emoji.images_path | |
Rails.application.config.assets.precompile += %w( search.js ) | |
# After | |
Rails.application.config.assets.tap do |assets| | |
assets.version = '1.0' | |
assets.paths << Emoji.images_path | |
assets.precompile += %w( search.js ) |
def score1(pins) | |
cursor = 0 | |
frame_points = [] | |
9.times do | |
frame_points << pins[cursor, 3] | |
cursor += 2 | |
if frame_points.last.first == 10 | |
cursor -= 1 | |
else | |
if frame_points.last.take(2).inject(:+) != 10 |
window.App = | |
Models: {} | |
Collections: {} | |
Views: {} | |
Routers: {} | |
init: (options)-> | |
options = {} unless options | |
options.pushState = true | |
options.hashChange = false # don't want to rewrite /pathname to #pathname |
シェルTIPS 20min | |
=========== | |
コンピュータの方がうまくできることに人間を使うな。 | |
-- Tom Duff | |
キーバインド | |
---------- | |
Emacs の基本操作とおなじ。 |
A quick comparison/ benchmark between Hogan, Dust, doT and underscore
Developed by Twitter (same team as Bootstrap), use exactly the same syntax as Mustache, but more performant and more stuff available server side.
My name is {{ name }}
def count_by_word(string) | |
fn = ->(s, h){ h[s] += 1 } | |
string | |
.scan(/\w+/) | |
.each_with_object(Hash.new(0), &fn) | |
end |
 | |
$n$を正の整数とする。$n$を割り切る正の整数が$1$個しかないとき、$n$を<b>単数</b>という。ちょうど$2$個あるとき、$n$を<b>素数</b>という。$3$個以上あるとき、$n$を<b>合成数</b>という。 | |
$$ | |
\begin{array}{|c|c|c|c|c|c|c|c|c|c} | |
\hline | |
\textbf{単数} & 1 & & & & & & & & & & \\ | |
\hline | |
\textbf{素数} & & 2 & 3 & & 5 & & 7 & & & & \\ | |
\hline | |
\textbf{合成数} & & & & 4 & & 6 & & 8 & 9 & 10 & \\ |
(注意)既にRVMを使ってRubyがインストール済みなので、OS X標準のRubyではなくHomebrewを使って別バージョンのRubyをインストールするまでのもろもろの準備は省いています。その部分が必要であれば、このあたりの記事の前段が参考になるかもしれません(Rails OS X Developer Guide)。
まずは、RVMをアンインストールしましょう。
$ rvm implode
#this script can never fail | |
#i use it in the fish_config | |
#call it with start_agent | |
setenv SSH_ENV $HOME/.ssh/environment | |
function start_agent | |
if [ -n "$SSH_AGENT_PID" ] | |
ps -ef | grep $SSH_AGENT_PID | grep ssh-agent > /dev/null |
a(;`・ω・)o━ヽ_。_・_゚_・_フ)) | |
?(っ´。ω゜`c) | |
☝(〃`l _ l´)☝ | |
☝( ◠‿◠ )☝ | |
༼(*꒪ั❥꒪ั*༽༽ | |
(✿꒪ั◡꒪ั✿) | |
(੭ु ˃̶͈̀ x ˂̶͈́)੭ु⁾⁾ | |
:(ヽ'ω`): | |
+。:.゚٩(๑>◡<๑)۶:.。+゚ | |
(★l ω l) |