A timeline of the last four years of detecting good old window.localStorage.
October 2009: 5059daa
| # 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')}, |
| (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 = {}; |
| #!/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); |
A timeline of the last four years of detecting good old window.localStorage.
October 2009: 5059daa
2013 Minori Yamashita ympby@gmail.com
-- ここにあなたの名前を追記 --
Vim Advent Calendar 2012 の230日目の記事です。昨日の記事は@manga_osyoさんで、明日の記事はvital.vimコミッタの@rbtnnさんです。
今回は意表をついてVim scriptの入門記事です。
Vim script初級者レベルを10段階に分割すると、そのうち簡単な方から3つは、以下のようになります。
| (function(global) { | |
| // Compatibility | |
| navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia; | |
| var peerClient; | |
| var currentPeerConnection; | |
| var localMediaStream; | |
| $(function() { |
By Saad Mousliki
御存知の通り、JavaScriptは数あるプログラミング言語のうちのひとつであり、モバイルのハイブリッドアプリ(PhoneGapやAppceleratorといった)や、サーバーサイド(NodeJSやWakanda)等の様々な所で実装されているWebの言語です。 また、Webブラウザにalertを出すところから、ロボットを動かす(nodebotやnodruinoを使って)ところまで様々なシーンで使われる言語となりました。 JavaScriptをマスターし、パフォーマンスの良いコードを生み出す開発者は市場で最も求められています。
| macro => { | |
| rule infix { ( $arg:ident (,) ... ) | { $body ... $last:expr } } => { | |
| (function x( $arg (,) ... ) { | |
| $( $body) ... | |
| return $last | |
| }).bind(this); | |
| } | |
| rule infix { ( $arg:ident (,) ... ) | $last:expr } => { | |
| (function x( $arg (,) ... ) { | |
| return $last |