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.
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.'); | |
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
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){ |
(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(": "); |
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); |
// “The URL code points are ASCII alphanumeric, "!", "$", "&", "'", "(", ")", | |
// "*", "+", ",", "-", ".", "/", ":", ";", "=", "?", "@", "_", "~", and code | |
// points in the ranges U+00A0 to U+D7FF, U+E000 to U+FDCF, U+FDF0 to U+FFEF, | |
// U+10000 to U+1FFFD, U+20000 to U+2FFFD, U+30000 to U+3FFFD, U+40000 to | |
// U+4FFFD, U+50000 to U+5FFFD, U+60000 to U+6FFFD, U+70000 to U+7FFFD, U+80000 | |
// to U+8FFFD, U+90000 to U+9FFFD, U+A0000 to U+AFFFD, U+B0000 to U+BFFFD, | |
// U+C0000 to U+CFFFD, U+D0000 to U+DFFFD, U+E1000 to U+EFFFD, U+F0000 to | |
// U+FFFFD, U+100000 to U+10FFFD.” | |
// — http://url.spec.whatwg.org/#url-code-points |
for file in `git diff-tree --no-commit-id --name-only -r HEAD | sort | uniq` | |
do | |
if [ ${file: -3} == ".py" ] | |
then | |
flake8 --ignore=E121,E123,E124,E125,E126,E127,E128 $file | |
fi | |
if [ ${file: -3} == ".js" ] | |
then | |
jshint $file | |
fi |
stopBefore(document, 'getElementById')
stopBefore('document.getElementById') // the same as the previous
stopBefore(Element.prototype, 'removeChild')