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
/* | |
* SEO server | |
* | |
* Generates and serves HTML snapshots for crawlers, esp. GoogleBot. | |
* See https://developers.google.com/webmasters/ajax-crawling/docs/specification | |
* | |
* Note: This is run by phantonjs, not node. See http://phantomjs.org | |
* | |
*/ | |
var system = require('system') |
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
/* | |
* Redirect _escaped_fragment_ requests to SEO server for HTML snapshots | |
* | |
* Place in your middleware stack. Watch out for correct placement: | |
* - after any static handler | |
* - before app routes (router) | |
* | |
* app.use(require('./seo-express-filter')(app)) | |
* | |
*/ |
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 toHex(s) { | |
// utf8 to latin1 | |
var s = unescape(encodeURIComponent(s)) | |
var h = '' | |
for (var i = 0; i < s.length; i++) { | |
h += s.charCodeAt(i).toString(16) | |
} | |
return h | |
} |
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
conky.config = { | |
background = true, | |
double_buffer = true, | |
alignment = 'top_right', | |
draw_shades = false, | |
use_xft = true, | |
font = 'Noto Mono:size=9', | |
minimum_width = 120, | |
maximum_width = 120, | |
gap_y = 150, |
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
/** | |
* A web worker pool implementation for parallel execution of | |
* computationally intensive operations. The pool will lazily grow up to its | |
* given capacity. On saturation, messages will be queued up until a worker | |
* from the pool becomes available. | |
* | |
* var capacity = 3; | |
* var pool = new WorkerPool(capacity, "./worker.js"); | |
* for (var i = 0; i < 10; i++) { | |
* pool.postMessage(msg, function(err, result) { |