Skip to content

Instantly share code, notes, and snippets.

@dantewang
dantewang / gitp2svnp.rb
Created December 26, 2011 02:52 — forked from zbyhoo/gitp2svnp.rb
Simple script converting git patch file into tortoise merge compatible format. Usage: gitp2svnp.rb <git_patch_file>
#!/usr/bin/ruby
if ARGV.length != 1
puts "usage: git2svn <file_name>"
puts " file_name - git patch file name"
exit
end
separator = "\n===================================================================\n"
new_file = false

Description copied from http://blog.zhaojie.me/2012/11/how-to-generate-typoglycemia-text.html

Typoglycemia是个新词,描述的是人们识别一段文本时的一个有趣的现象:只要每个单词的首尾字母正确,中间的字母顺序完全打乱也没有关系,照样可以正常理解。例如这么一段文字:

I cdnuol't blveiee taht I cluod aulaclty uesdnatnrd waht I was rdanieg: the phaonmneel pweor of the hmuan mnid. Aoccdrnig to a rseearch taem at Cmabrigde Uinervtisy, it deosn't mttaer in waht oredr the ltteers in a wrod are, the olny iprmoatnt tihng is taht the frist and lsat ltteer be in the rghit pclae. The rset can be a taotl mses and you can sitll raed it wouthit a porbelm. Tihs is bcuseae the huamn mnid deos not raed ervey lteter by istlef, but the wrod as a wlohe. Scuh a cdonition is arppoiatrely cllaed Typoglycemia.

Amzanig huh? Yaeh and you awlyas thguoht slpeling was ipmorantt.

我们其实可以较为轻松地识别出其原文: