例えば、buttonの左辺をcontainer viewから20ポイント離す場合
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = (grunt) -> | |
require('load-grunt-tasks')(grunt) | |
grunt.initConfig | |
jade: | |
compile: | |
files: [ | |
expand : true, | |
src : [ | |
'jade/**/*.jade' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
var total = {}; | |
var year = '2012'; | |
var all = false; | |
function init(num) { | |
if(typeof num !== 'number') { | |
num = 0; | |
$('<div/>').css({ | |
position: 'fixed', | |
left: 0, |
Backbone.js とかで JavaScript で MVC してるサンプルとかを読んでいると、 HTML の可変部分はテンプレートエンジンの使用が推奨されているようだが (例: http://backbonejs.org/docs/todos.html )、 サーバー側と違ってクライアント側では DOM 操作ができるので、わざわざテンプレートエンジン使ってテキストベースでやるよりも、 DOM を jQuery で直接操作した方が分かりやすいんじゃないかと思った。
デザイナーが HTML、プログラマー が JavaScript と担当者を分ける場合には便利なのかな。
Original: "Callbacks are imperative, promises are functional: Node's biggest missed opportunity" by James Coglan
Translated by Yuta Okamoto (@okapies)
- 訳者は JavaScript や Node.js に関する専門知識がほとんどありません。識者のツッコミをお待ちしております。「◯◯が分からない」等も歓迎です。
- 元記事から構成を一部変更しています。また、関数型プログラミングに関する記述のうち、議論の骨子に絡まないものは省略しています。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Mock APNS server | |
*/ | |
var net = require('net'); | |
var HOST='127.0.0.1'; | |
var PORT=7777; | |
// Need this option so the client doesn't close | |
// the connection on sending a FIN |
Locate the section for your github remote in the .git/config
file. It looks like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = git@github.com:joyent/node.git
Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/*
to this section. Obviously, change the github url to match your project's URL. It ends up looking like this: