Vim Advent Calendar 2012 の230日目の記事です。昨日の記事は@manga_osyoさんで、明日の記事はvital.vimコミッタの@rbtnnさんです。
今回は意表をついてVim scriptの入門記事です。
Vim script初級者レベルを10段階に分割すると、そのうち簡単な方から3つは、以下のようになります。
Vim Advent Calendar 2012 の230日目の記事です。昨日の記事は@manga_osyoさんで、明日の記事はvital.vimコミッタの@rbtnnさんです。
今回は意表をついてVim scriptの入門記事です。
Vim script初級者レベルを10段階に分割すると、そのうち簡単な方から3つは、以下のようになります。
2013 Minori Yamashita ympby@gmail.com
-- ここにあなたの名前を追記 --
A timeline of the last four years of detecting good old window.localStorage.
October 2009: 5059daa
| #!/bin/node | |
| // via http://starwing.net/suddenly_death.html | |
| String.prototype.lengthByte = function() | |
| { | |
| var str = this; | |
| var r = 0; | |
| for (var i = 0; i < str.length; i++) { | |
| var c = str.charCodeAt(i); |
| (function (window) { | |
| // This library re-implements setTimeout, setInterval, clearTimeout, clearInterval for iOS6. | |
| // iOS6 suffers from a bug that kills timers that are created while a page is scrolling. | |
| // This library fixes that problem by recreating timers after scrolling finishes (with interval correction). | |
| // This code is released in the public domain. Do with it what you want, without limitations. I do not promise | |
| // that it works, or that I will provide support (don't sue me). | |
| // Author: rkorving@wizcorp.jp | |
| var timeouts = {}; |
| # encoding: utf-8 | |
| environment_seed_file = File.join(Rails.root, 'db', 'seeds', "#{Rails.env}.rb") | |
| def seed_image(file_name) | |
| File.open(File.join(Rails.root, "/app/assets/images/seed/#{file_name}.jpg")) | |
| end | |
| products = [ | |
| {:name => 'foo', :description => 'lorem ipsum', :product_type => ProductType.find_by_name('Sandwiches')}, |