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
"use strict"; | |
var express = require('express') | |
, http = require('http') | |
, path = require('path') | |
, io = require('socket.io') | |
, connect = require("express/node_modules/connect") | |
, Session = express.session.Session | |
, app = express(); | |
//メモリストアかRedisのどちらかでセッションを保存 |
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<title>JavaScript Patterns</title> | |
<meta charset="utf-8"> | |
</head> | |
<body> | |
<script> | |
/* Title: window scroll event | |
* Description: avoid attaching handlers to the window scroll event |
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
/** | |
* _.templateSettingsにてテンプレートの区切り文字を変更してます。 | |
* デフォルトは<%%>なので、Mustache.jsのような{{}}に変えてます。 | |
*/ | |
_.templateSettings = { | |
interpolate : /\{\{(.+?)\}\}/g | |
}; | |
var tmpl = _.template($('#tmpl_hoge').html()); |
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
diff --git a/index.html b/index.html | |
index 581e230..5b790e4 100644 | |
--- a/index.html | |
+++ b/index.html | |
@@ -3,6 +3,8 @@ | |
<head> | |
<meta http-equiv="content-type" content="text/html;charset=UTF-8" /> | |
<meta http-equiv="X-UA-Compatible" content="chrome=1" /> | |
+ <meta name="viewport" content="width=device-width"> | |
+ <link rel="canonical" href="http://backbonejs.org" /> |
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 = function(grunt) { | |
grunt.initConfig({ | |
//some... | |
handlebars: { | |
compile: { | |
options: { | |
namespace: "MyApp.Templates", |
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
jQuery.page = jQuery({}); //空のオブジェクト | |
//Usage | |
jQuery.page.bind('change', function(e, title){ | |
jQuery('#text').text('Page is' + title); | |
}); | |
jQuery.page.trigger('change', 'Inbox'); |
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
var timeout; | |
function warning() { | |
timeout = setTimeout(function() { | |
alert('You stayed'); | |
}, 1000); | |
return "You are leaving the page"; | |
} | |
function noTimeout() { |
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
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="description" content="" /> | |
<meta name="author" content="" /> | |
<title></title> | |
</head> | |
<body> |
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
$ git submodule foreach 'git pull origin master' | |
//これをやると元に戻る...orz | |
$ git submodule update |
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
<!DOCTYPE html> | |
<!--[if lt IE 7 ]> <html lang="ja" class="no-js ie6"> <![endif]--> | |
<!--[if IE 7 ]> <html lang="ja" class="no-js ie7"> <![endif]--> | |
<!--[if IE 8 ]> <html lang="ja" class="no-js ie8"> <![endif]--> | |
<!--[if IE 9 ]> <html lang="ja" class="no-js ie9"> <![endif]--> | |
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="ja" class="no-js"> <!--<![endif]--> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="description" content="" /> | |
<meta name="author" content="" /> |