This file contains hidden or 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 MOVE_THRESHOLD = 20; | |
// 'tap'イベントをjQueryに登録 | |
$.event.special.tap = { | |
setup: function() { | |
var self = $(this); | |
self.on('touchstart', function(e) { | |
var moved = false, | |
origTarget = e.target, | |
origEvent = e.originalEvent, |
This file contains hidden or 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
// always defined locals | |
res.locals.user = req.user; | |
// cached locals | |
if (req.xhr) { return next(); } | |
console.log(req.url); | |
/* ************ * | |
* Non XHR only | |
* ************ */ |
This file contains hidden or 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
/* | |
use dot separated string as nested object path | |
and parse it to get the value | |
*/ | |
// sample nested object: | |
var messages = | |
errors: { | |
username: { | |
validation: 'Username is invalid' | |
} |
This file contains hidden or 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
/* node getImages.js http://www.yahoo.co.jp */ | |
var htmlparser = require('htmlparser'); | |
var sys = require('sys'); | |
var http = require('http'); | |
var fs = require('fs'); | |
var url = require('url'); | |
var path = require('path'); | |
if(process.argv.length !== 3){ |
NewerOlder