- 000000 0 Elements are identical.
- 000001 1 The nodes are in different documents (or one is outside of a document).
- 000010 2 Node B precedes Node A.
- 000100 4 Node A precedes Node B.
- 001000 8 Node B contains Node A.
- 010000 16 Node A contains Node B.
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
<link href='http://fonts.googleapis.com/css?family=Michroma' rel='stylesheet' type='text/css'> | |
<link href='http://fonts.googleapis.com/css?family=Damion' rel='stylesheet' type='text/css'> | |
<div class="menu"> | |
<div class="menuItem uno">1<span>uno</span></div> | |
<div class="menuItem dos">2<span>dos</span></div> | |
<div class="menuItem tres">3<span>tres</span></div> | |
<div class="menuItem cuatro">4<span>cuatro</span></div> | |
<div class="menuItem cinco">5<span>cinco</span></div> | |
</div> |
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 makePredicate(words) { | |
words = words.split(/\s*,\s*|\s+/); | |
var f = "", cats = []; | |
out: for (var i = 0; i < words.length; ++i) { | |
for (var j = 0; j < cats.length; ++j) | |
if (cats[j][0].length == words[i].length) { | |
cats[j].push(words[i]); | |
continue out; | |
} | |
cats.push([words[i]]); |
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
# options then you can get the mode options at the task callback with the first arguments (options.mode etc) | |
option '-m', '--mode [Mode]', 'watcher mode' | |
{exec} = require 'child_process' | |
task 'test', 'Runs all Jasmine specs in spec/ folder', -> | |
test() | |
task 'compile', 'Compiles coffee in src/ to js in bin/', -> |
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'; | |
/* Directives */ | |
angular.module('wb.directives', []). | |
directive('appVersion', ['version', function(version) { | |
return function(scope, elm, attrs) { | |
elm.text(version); | |
}; |
欢迎补充
目标框架条件就是热门(一个框架热门总是有其原因的), 会带上框架的slogan(框架作者最懂自己的孩子, 这点国外的框架做得都非常好)
1. jQuery ♥
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 str2obj = function(str){ | |
var reg = /^\s*([^:]*)\s*:\s*([^:;]*);/g,tmp = {} | |
while(str = str.replace(reg, function(all, left, right){ | |
tmp[left] =right | |
console.log(str,all) | |
return "" | |
})){} | |
return tmp | |
} |
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
@media only screen and (min-width: 768px) and (max-width: 980px){ | |
body::before{ | |
content: "Tablet media query (768px < 980px) fired"; | |
font-weight: bold; | |
display: block; | |
text-align: center; | |
background: rgba(255,255,0, 0.9); | |
position: absolute; | |
top: 0; | |
left: 0; |
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(global){ | |
// Exposure AMD COMMANDJS or GLOBAL ASSIGN | |
// ---------------------------------------------------------------------- | |
if (typeof exports === 'object') { //commonjs 模式 | |
module.exports = namespace; | |
} else if (typeof define === 'function' && define.amd) { //amd 模式 requirejs | |
define(function() { | |
return namespace | |
}); | |
} else { // 全局模式 |
├── node_modules/
│ └── ...
├── public/
│ ├── jam/
│ │ ├── ...
│ │ └── require.js
│ ├── client.js
│ ├── index.html
│ └── style.css