世間はReactの話題で持ちきりのようだけど、Backbone.jsでStyleStatsのWebアプリをリニューアルした。以上で伝えることは終わったが、リニューアルするにあたってつらかったことをつらつらかきとめておく。 StyleStats - An evaluating tool for writing better CSS そもそもBackbone使うほど複雑なアプリでもないんだけど、勉強がてら使ってみた。てかParse.comを使いたくて、それがBackboneベースのSDKだったからというのもある。 Parse.comはmBaaS(mobile Backend as a Service)の類で、データを簡単にストアしてくれるもの。僕のようなフロント側の人間でバックエンドがからっきしな人も、こうゆうのを使うとWebアプリケーションを簡単に作れるそうだ。StyleStatsで、テスト
This blog post is outdated. Please read chapter “Generators” in “Exploring ES6”. This blog post is part of a series on iteration in ES6: Iterables and iterators in ECMAScript 6 ES6 generators in depth Generators, a new feature of ECMAScript 6 [1], are functions that can be paused and resumed. This helps with many applications: iterators, asynchronous programming, etc. This blog post explains how g
Wheel the Force be with you wheelnav.js brings spinning into your web pages Download Wheel navigation JavaScript library built on SVG It can be tab navigation, pie menu, sub menu and more Examples Include wheelnav.js, add a div, create wheelnav on div It is possible via JavaScript or HTML5 data attributes Documentation
Promise オブジェクトは、非同期処理の完了(もしくは失敗)の結果およびその結果の値を表します。 プロミスの挙動と使用法について学ぶには、最初にプロミスの使用をお読みください。 プロミス (Promise) は、作成された時点では分からなくてもよい値へのプロキシーです。非同期のアクションの成功値または失敗理由にハンドラーを結びつけることができます。これにより、非同期メソッドは結果の値を返す代わりに、未来のある時点で値を提供するプロミスを返すことで、同期メソッドと同じように値を返すことができるようになります。 Promise の状態は以下のいずれかとなります。 待機 (pending): 初期状態。成功も失敗もしていません。 履行 (fulfilled): 処理が成功して完了したことを意味します。 拒否 (rejected): 処理が失敗したことを意味します。 待機状態のプロミスの 最終
Javascript minification is a technique which condenses your script into a much smaller footprint. You lose human readability but you conserve considerable bandwidth – in the end, Javascript is meant for your browser not for your users. Most production websites use Javascript modification, but the way this is achieved varies greatly. From simple online converters to more comprehensive GUI tools to
I'm pretty sure my understanding of generators is inherently broken. All online resources seem to conflict and it makes for an incredibly difficult and confusing learning experience. From what I understand, the yield keyword enables a currently executing block of code to wait for a value instead of throwing remaining code to be executed inside a callback. So, as most tutorials have pointed out, yo
For full functionality of this site it is necessary to enable JavaScript. Here are the instructions how to enable JavaScript in your web browser.
In this chapter, I: discuss nested callbacks and control flow in Node introduce three essential async control flow patterns: Series - for running async tasks one at a time Fully parallel - for running async tasks all at the same time Limitedly parallel - for running a limited number of async tasks at the same time walk you through a simple implementation of these control flow patterns and convert
Perl には Test::TCP というのがあって、テスト中、空いてるポートで何かしらのサーバーを起動して使うということができます。Ruby においては Glint というライブラリがあって、同じことができます。 node.js の場合、node-test-tcp というのがあって、node の net.Server で動くサーバに関しては簡単に同じことができます。が、memcached とか外部プロセスを起動させようとするとちょっと困るのと、done() を呼ばないと終了しないので、何かいい方法はないかなと思ったので書いてみました。 https://github.com/cho45/node-glint test-tcp だとカブるので glint のほうの名前を仮りています。 つかいかた glint( function (port) { // ここは外部プロセスで実行される // た
JavaScript 1.7 はいくつかの新機能、特にジェネレータ (generators)、イテレータ (iterators)、配列内包 (array comprehensions)、let 式 (let expressions)、および分割代入 (destructuring assignment) を取り入れた言語アップデートです。JavaScript 1.6 のすべての機能も含まれています。 JavaScript 1.7 のサポートは Firefox 2 に導入されました。 この記事に含まれるコードの例は JavaScript シェルから実験できます。Introduction to the JavaScript shell を読み、シェルのビルド方法と使い方を学んでください。 JavaScript 1.7 の一部の新機能を使うためには、JavaScript 1.7 が使いたいという宣
これは「Node.js Advent Calendar」7日目の記事です。 去年のアドカレ (東京Node学園祭用で12月じゃなかったけど) 以来、リリースの告知エントリ一つしか書いてなかったよ。ブログだけじゃなくTwitterもたいしてつぶやいてないし、ネットからのフェードアウトが進んでおりまする。あー、なにも残さず消えるように死ねたらいいのに。実際には今死ぬと膨大なゴミ (大半は書籍と雑誌だけど) を残すので早く処分しないと死ぬに死ねない。 ともあれ (JW)、今回はRendrについてダラダラと書きます。まとまりなくてごめんなさいです。 自分がRendrを知ったのは、@mshkさんによるQiitaの記事からでした。 Rendr入門(1): Node.js + Backbone.jsでサーバ & クライアントを構築する"Rendr"の紹介 Rendr入門(2): リクエスト処理の流れ(R
Photo by midnightglory 多言語対応のサイトを作っていると問題になるのが、メッセージの切り替えです。PHPやRailsを使っている場合は、HTTP_ACCEPT_LANGUAGEを見てメッセージ生成を切り替えれば良いのですが、静的ファイルの場合は、そうは行きません。 そこで、今回はJavascriptだけでブラウザの言語を取得する方法を調べてみました。 ググっていると、ブラウザ依存ですが取得する方法が見つかったので、各ブラウザで検証した所、navigator.browserLanguage、navigator.language、navigator.userLanguageのいずれかで取得できることが分りました。 ただ、この値はブラウザのデフォルト言語環境のなので、HTTP_ACCEPT_LANGUAGEとは違う値が返ってきます。たとえば、日本語OSに英語版のFirefo
jQuery#triggerのテスト describe('jQuery#trigger', function() { it('イベントハンドラに値を渡せること', function(done) { var $el = $('<div>'); $el.bind('foo', function(event, val) { expect(val).to.be('bar'); done(); }); $el.trigger('foo', 'bar'); }); }); コールバックが2回呼ばれるかをテスト describe('jQuery#trigger', function() { it('イベントハンドラに値を渡せること', function(done) { var $el = $('<div>'); var count = 0; $el.bind('foo', function(event,
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く