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
<h1 class="election-section">Electorate Results</h1> | |
<p class="count"><span class="percentcounted">79.5</span>% Counted. Updated <span class="updatedtime">9 Oct 2015, 11:14pm</span></p> | |
<div class="afterprefs placeholder"> | |
<div class="election-well"> | |
<h2>Count After Preferences</h2> | |
</div> | |
<div class="module afterprefs electable"> | |
<table class="manual eg-table results-table"> | |
<thead> |
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
if (navigator.mozApps && window.locationbar.visible === false) { | |
var externalLinks = document.querySelectorAll("a[href^='http']:not([href*='"+location.host+"'])"); | |
for (var i = 0; i < externalLinks.length; ++i) { | |
externalLinks[i].setAttribute("target", "_blank"); | |
} | |
} |
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
<div id="stage"> | |
<canvas id="ui-layer" width="480" height="320"></canvas> | |
<canvas id="game-layer" width="480" height="320"></canvas> | |
<canvas id="background-layer" width="480" height="320"></canvas> | |
</div> | |
<style> | |
#stage { | |
width: 480px; | |
height: 320px; |
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 Storage = { | |
_cache: {}, | |
get: function (key) { | |
if (!this._cache[key]) { | |
this._cache[key] = localStorage[key]; | |
} | |
return this._cache[key]; | |
}, |
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 objectPool = []; | |
var marker = 0; | |
var poolSize = 0; | |
//any old JavaScript object | |
function commonObject () { } | |
commonObject.create = function () { | |
if (marker >= poolSize) { | |
commonObject.expandPool(poolSize * 2); |
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 entityMap = { | |
"&": "&", | |
"<": "<", | |
">": ">", | |
'"': '"', | |
"'": ''', | |
"/": '/' | |
}; | |
function escapeHtml (string) { |
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
/** | |
* @author Louis Stowasser <[email protected]> | |
* License: MIT | |
*/ | |
function generateTOC (rootNode, startLevel) { | |
var lastLevel = 0; | |
startLevel = startLevel || 2; //which H# tag to start indexing. | |
var html = "<ul>"; |
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
/** | |
* Shim the require function used in node.js | |
*/ | |
(function() { | |
if (window.require !== undefined) | |
throw 'RequireException: \'require\' already defined in global scope'; | |
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(blog, limit) { | |
limit = +limit || 10; | |
var scriptTags = document.getElementsByTagName('script'); | |
var scriptNode = scriptTags[scriptTags.length - 1]; | |
var recent = document.createElement("div"); | |
scriptNode.parentNode.appendChild(recent); | |
recent.setAttribute("class", "widget"); | |
recent.setAttribute("id", "TumblrRecentPosts"); |
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
#Performance Testing Framework | |
Performance is a very important factor for JavaScript games. It becomes | |
a cruciual factor when you bring mobile devices into the mix. | |
Luckily we have some great tools for testing different methods of coding | |
such as JSPerf.com. This lets developers see which browsers perform best | |
doing what. | |
On the same vein, JSGameBench stress tested rendering methods for browsers |
NewerOlder