git clone https://github.com/YOUR-USERNAME/Spoon-Knife
git remote -v
| class EventEmitter{ | |
| constructor(){ | |
| this.events = null ; | |
| } | |
| on(name , callback , ctx){ | |
| let events = this.events || (this.events = {}); | |
| let handlers = events[name] || (events[name] = []); | |
| handlers.push({ |
| crosRequest(url, opts) { | |
| var req; | |
| var noop = function() {}; | |
| opts = opts || {}; | |
| var method = opts.method || 'GET'; | |
| var onSuccess = opts.onSuccess || noop; | |
| var onError = opts.onError || noop; | |
| var data = opts.data || {}; | |
| var onTimeout = opts.onTimeout || noop; | |
| var timeout = opts.timeout; |
| var gulp = require('gulp'), | |
| source = require('vinyl-source-stream'), | |
| rename = require('gulp-rename'), | |
| browserify = require('browserify'), | |
| es = require('event-stream'); | |
| gulp.task('default', function() { | |
| // set entry files | |
| var files = [ | |
| './app/entry-a.js', |
| // disable :hover on touch devices | |
| // based on https://gist.github.com/4404503 | |
| // via https://twitter.com/javan/status/284873379062890496 | |
| // + https://twitter.com/pennig/status/285790598642946048 | |
| // re http://retrogamecrunch.com/tmp/hover | |
| // NOTE: we should use .no-touch class on CSS | |
| // instead of relying on this JS code | |
| function removeHoverCSSRule() { | |
| if ('createTouch' in document) { | |
| try { |
| $('<img>').on({ | |
| 'load': function($e){ | |
| console.log('image loaded successfully'); | |
| }, | |
| 'error': function($e){ | |
| console.log('image loaded failed'); | |
| } | |
| }).appendTo('body'); |
| IE6 Only | |
| ================== | |
| _selector {...} | |
| IE6 & IE7 | |
| ================== | |
| *html or { _property: } | |
| IE7 Only | |
| ================== |
| (function($){ | |
| var $d = $({}); | |
| var Dispatcher = { | |
| on:function(event , callback , ctx){ | |
| var proxy = $.proxy(callback , ctx); | |
| $d.on(event,proxy); | |
| }, |
###语言规范
###前端框架
###前端工具
###模板引擎
###性能指南
| #batch compress js | |
| sudo java -jar yuicompressor-2.4.8.jar --type js -o '.js:-min.js' *.js | |
| #batch compress css | |
| sudo java -jar yuicompressor-2.4.8.jar --type css -o '.css:-min.css' *.css |