I'm trying to get my head around all the search stuff so it's a good time to have a NodeBase call about it.
Some collected links, please add to them in comments.
/* | |
You want to use webworkers, but you host all of your js files on a different domain than where | |
your app lives (es. app.example.com and js.example.com). Given that the static file served from | |
js.example.com are CORS ready (in that the response header includes Accept-origin: *), I thought | |
I could load a Worker from other domains. I was almost wrong, but at last I found a solution: | |
XHRing the worker source and create an inline worker. This is tested only on Firefox (latest). | |
*/ | |
// This is an example webworker that is on js.example.com. It just echoes messages it receive. | |
self.onmessage = function(e) { | |
self.postMessage(e.data); |
I'm trying to get my head around all the search stuff so it's a good time to have a NodeBase call about it.
Some collected links, please add to them in comments.
(function() { | |
var CSSCriticalPath = function(w, d, opts) { | |
var opt = opts || {}; | |
var css = {}; | |
var pushCSS = function(r) { | |
if(!!css[r.selectorText] === false) css[r.selectorText] = {}; | |
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/); | |
for(var i = 0; i < styles.length; i++) { | |
if(!!styles[i] === false) continue; | |
var pair = styles[i].split(": "); |
var sanitize = (function(doc){ | |
var slice = Array.prototype.slice, | |
range = doc.createRange(), | |
frag = doc.createDocumentFragment(), | |
wrap = frag.appendChild(doc.createElement('div')); | |
function cleanNode(node, unwrap){ | |
var parent = node.parentNode; | |
if (unwrap){ |
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
var child_process = require('child_process'); | |
start(); | |
function start(nodefile) { | |
if (typeof start !== 'string') { | |
console.log('Has none file. like this: start("app.js")'); | |
} | |
console.log('Master process is running.'); | |
function toJSON(node) { | |
let propFix = { for: 'htmlFor', class: 'className' }; | |
let specialGetters = { | |
style: (node) => node.style.cssText, | |
}; | |
let attrDefaultValues = { style: '' }; | |
let obj = { | |
nodeType: node.nodeType, | |
}; | |
if (node.tagName) { |
var dombind = (function() { | |
function makeSmart(obj) { | |
obj.__bound__ = {}; | |
} | |
function isSmart(obj) { | |
return '__bound__' in obj; | |
} |