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
<article class="recipe"> | |
<div class="pull-right"> | |
<a href="#"><img data-src="holder.js/161x121/industrial" width="161" height="121" alt=""></a> | |
</div> | |
<header> | |
<h6><a href="#"><b class="key">Chicken</b> Piccata</a></h6> | |
<p>Recipe courtesy of <a href="#">Giada De Laurentiis</a></p> | |
</header> | |
<div class="media"> | |
<div class="pull-left"> |
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 desktop($trigger, id){ | |
var $menu = $trigger.find('+ .dropdown-menu'), delay=st.delay, delay2 = ~~delay/3; | |
//bootstrap catches the click event so we need to jump to the link here | |
$trigger.on('click', function(e){ | |
clearTimeout(waiting[id]); | |
if (id === inside){ | |
inside = 0; | |
//we need to trigger click tracking since click event is not fired |
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 compare(nodeA, nodeB) { | |
if ( !nodeA && !nodeB ) return true; //edge case | |
if ( nodeA.nodeType === nodeB.nodeType && nodeA.tagName === nodeB.tagName && nodeA.nodeValue === nodeB.nodeValue ){ | |
var i = 0; | |
var childA = nodeA.childNodes[i]; | |
var childB = nodeB.childNodes[i]; | |
while(childA && childB){ | |
if (!compare(childA, childB)) return false; //some child is not equal | |
i++; | |
childA = nodeA.childNodes[i]; |
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
var unboundSlice = Array.prototype.slice; | |
var slice = Function.prototype.call.bind(unboundSlice); | |
function listToArray() { | |
return slice(arguments); | |
} | |
function listToArray2() { | |
return Array.prototype.slice.call(arguments); | |
} |
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 walkDOM(node, cb){ | |
cb(node); | |
node = node.firstChild; | |
while(node){ | |
walkDOM(node, cb); | |
node = node.nextSibling; | |
} | |
} | |
function walkUp(node, cb){ | |
var parent = node.parentElement; |
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(){ | |
function doComponent(data){ | |
return <div id={data.id}> | |
<h3>{data.title}</h3> | |
<div className="clients">{data.content.clients}</div> | |
<div className="sales"}>{data.content.sales}</div> | |
</div>; | |
} |
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
<html> | |
<body> | |
<h1>Socket.io Test!!! :)</h1> | |
<form id="myForm"> | |
<input id="firstname" type="text"> | |
<input id="lastname" type="text"> | |
<input id="submit" type="submit"> | |
</form> | |
<script src="http://localhost:3001/socket.io/socket.io.js"></script> | |
<script> |
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
var cache = require("./cache-service"); | |
var http = require("./http-monitor"); | |
var NOT_READY = { statusCode:202, data:"" }; | |
function doRequest(serviceID, httpReq, serviceResults){ | |
var httpRes = { //overrides httpRes.json() dispatches data without blocking the browser | |
json:function(statusCode, data){ | |
if (arguments.length === 1){ | |
data = statusCode; |
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
var cache = require("./cache"); | |
function doRequest(url, httpRes){ | |
var data = cache.get(url); | |
if (data){ | |
httpRes.json(200, JSON.parse(data)); | |
} | |
return !!data; | |
} |
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
var http = require("http"); | |
var log = require("./log"); | |
var cache = require("./cache"); | |
var getRequestTime = require("./request-time"); | |
var requestList = []; //request buffer | |
//register a Node.js http request then monitor the request | |
//monitor means to check if the request is in process, a duplicate or it finished | |
function registerRequest(url){ |