####python
- webtc
- lessons from http://www.liaoxuefeng.com/wiki/001374738125095c955c1e6d8bb493182103fac9270762a000
- write some codes everday
####javascript
var Player = Backbone.Model.extend({ | |
defaults: { | |
"name": "James", | |
"kit": 10 | |
} | |
}); | |
var james = new Player(); | |
james.on('change:kit', function(model) { | |
console.log("my new number is " + model.get('kit')); |
<!-- target:planForm --> | |
<div class="plan-form"> | |
<h4>输入推广计划名称</h4> | |
<input data-ui="id:PlanName;type:TextBox;width:250" placeholder="计划名称"> | |
<label data-ui="id:PlanNameHint;type:Label"></label> | |
<label data-ui="id:PlanNameValidity;type:Validity"></label> | |
<p> | |
<span data-ui="id:CreateBtn;type:Button">确定</span> | |
<span data-ui="id:CancelBtn;type:Button">取消</span> |
/** | |
* @file 新建的View类模板 | |
* @author zhangxuan06 | |
*/ | |
define(function (require) { | |
require('er/tpl!./form.tpl.html'); | |
var langPlan = require('biz/lang/plan'); |
/** | |
* @file 计划新建或编辑的Model | |
* @author zhangxuan06 | |
*/ | |
define(function (require) { | |
var Model = require('er/Model'); | |
var util = require('er/util'); | |
var url = require('biz/url'); |
/** | |
* @file 计划新建或编辑的Action | |
* @author zhangxuan06 | |
*/ | |
define(function (require) { | |
var Action = require('er/Action'); | |
/** | |
* 新建计划Action的构造函数 |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
</body> | |
</html> |
<ul class="mp-hotsale-list" id="anti-encrypt-hotsale"> | |
{%foreach from=$data.list.areaD key=key item=item%} | |
<li data-gap="{%$item.etime - $data.common_info.timestamp%}" class="mp-hotsale-item | |
{%if ($key+1) eq $data.list.areaD|@count %} mp-hotsale-noborder {%/if%}"> | |
<h3>{%$item.title%}</h3> | |
<div class="mp-hot-brand"> | |
<img src="{%$item.brandlogo%}" alt="{%$item.title%}"/> | |
</div> | |
<div class="mp-hotsale-info"> | |
<div class="mp-hotsale-text"> |
import os,sys | |
dirname = sys.argv[1] | |
totalCount = 0; | |
cDir = os.getcwd() | |
#allowd file extsions, .js, .css ... | |
extDir = ['.js', '.less', '.tpl', '.html'] | |
#dir avoided to be checked | |
avoidDir = ['index/tpl', 'index/js'] |
####python
####javascript
//inspired by http://www.liaoxuefeng.com/wiki/001374738125095c955c1e6d8bb493182103fac9270762a000/001386819873910807d8c322ca74d269c9f80f747330a52000 | |
//python version on the way | |
//a javascript clousure sample | |
function testSum() { | |
var argsArr = Array.prototype.slice.call(arguments); | |
function sum() { | |
//clousure can get the acess to outer args and private variable | |
var sumNum = 0; | |
for(var i =0, len = argsArr.length; i < len; i++){ |