Netzz

tips collection

NAVIGATION - SEARCH

Google Chrome blocks scripts and fonts loaded in http from page running https

When you use CDN to load scripts and fonts from a page running in https you have to use https for every external url avoiding mixing content:

https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js
https://fonts.googleapis.com/css?family=Open+Sans

You can also omit the http: from the url letting the browser use the same protocol of the page.

Create XML using jQuery

With jQuery you can manipulate XHTML documents and create HTML fragments.

But you can also create XML documents and serialize them to string:

var doc = $.parseXML('<?xml version="1.0" encoding="utf-8" ?><Root xmlns="http://www.w3.org/1999/xhtml" />');
var $Root = $(doc.documentElement);
$('<cmd>').appendTo($Root).attr('Upper', 'val').text('action');
var xml=(new XMLSerializer()).serializeToString(doc)
//var xml=$("<dummy>").append($Root.clone()).html();
$(document.body).text(xml);

To be sure attributes are not lowered you have to append the element to it's parent before setting attributes.

You can also create an XML fragment in the same way:

var doc = $.parseXML('<Root />');
var $Root = $(doc.documentElement);
$('<cmd>').appendTo($Root).attr('Upper', 'val').text('action');
var xml=(new XMLSerializer()).serializeToString(doc)
//var xml=$("<dummy>").append($Root.clone()).html();
$(document.body).text(xml);

 

SpamAssassin for hMailServer

hMailServer is a good and free e-mail server for Windows. You can also integrate it with SpamAssassin to identify spam.

  1. Download SpamAssassin for Windows from Jam Software here
  2. Download NSSM here and save it in c:\Windows. Then type "nssm install SpamAssassin” in a console
  3. Select "spamd.exe" in SpamAssassin installation folder as application.
  4. Put these parameters in options field: -l -s spamd.log --round-robin
  5. Go to services control panel and start SpamAssassin
  6. Set options in hMailServer to use SpamAssassin
  7. Set up a new scheduled task to run sa-update.bat to automate the process of downloading and installing new rules and configuration