MySQLWorkbench: Lost connection to MySQL server during query

While running some difficult querys in MySQLWorkbench I ran into this the error: “Lost connection to MySQL server during query”
After searching google for a while I found a fix. MySQLWorkbench has a fixed max running time for querys that you can alter in the preferences:
Go to Preferences > SQL Editor and increase the value of the “DBMS connection read time out” field.

Related Blogs

  • Related Blogs on

Posted in a note to self, MySQL

adding a rule to CSSLint

I’ve been looking for a way to enforce naming conventions for a while. Last night I finally got to testing how this could be done with CSSLint. It turns out this is pretty easy if you know Javascript.

First you have to download the zip file from Github. In it you’ll find a src folder. All the rules are in the … you guessed it, rules folder.

For my first rule, I wanted to check that all class names used dash (-) instead of underscore(_). I started out from one of the other rules, “adjoining classes”.

/*global CSSLint*/
/*
 * Rule: Don't use adjoining classes (.foo.bar).
 */
CSSLint.addRule({

    //rule information
    id: "adjoining-classes",
    name: "Disallow adjoining classes",
    desc: "Don't use adjoining classes.",
    browsers: "IE6",

    //initialization
    init: function(parser, reporter){
        var rule = this;
        parser.addListener("startrule", function(event){
            var selectors = event.selectors,
                selector,
                part,
                modifier,
                classCount,
                i, j, k;

            for (i=0; i < selectors.length; i++){
                selector = selectors[i];
                for (j=0; j < selector.parts.length; j++){
                    part = selector.parts[j];
                    if (part.type == parser.SELECTOR_PART_TYPE){
                        classCount = 0;
                        for (k=0; k < part.modifiers.length; k++){
                            modifier = part.modifiers[k];
                            if (modifier.type == "class"){
                                classCount++;
                            }
                            if (classCount > 1){
                                reporter.report("Don't use adjoining classes.", part.line, part.col, rule);
                            }
                        }
                    }
                }
            }
        });
    }

});

I updated the code to the version below.

/*
 * Rule: test naming conventions: no underscores in classnames
 */
/*global CSSLint*/
CSSLint.addRule({

    //rule information
    id: "namingconventions-nounderscore",
    name: "Disallow classes with underscores",
    desc: "classnames should use dash instead of underscore",
    browsers: "All",

    //initialization
    init: function(parser, reporter){
        var rule = this;

        parser.addListener("startrule", function(event){
            var selectors = event.selectors,
                selector,
                part,
                modifier,
                i, j, k;

            for (i=0; i < selectors.length; i++){
                selector = selectors[i];
                for (j=0; j < selector.parts.length; j++){
                    part = selector.parts[j];
                    if (part.type == parser.SELECTOR_PART_TYPE){
                        for (k=0; k < part.modifiers.length; k++){
                            modifier = part.modifiers[k];
                            if (modifier.type == "class"){
                                if (/[^\.A-Za-z0-9-]/.test(modifier)){
                                    reporter.report("Classnames should follow naming conventions: only alphanumeric and dashes!", modifier.line, modifier.col, rule);
                                }
                            }

                        }
                    }
                }
            }
        });
    }

});

After this you also have to create a file with the same name in the tests folder. After updating the tests to your rule set, you need to build a new version.
Building is done with Ant so, you go to the root of your folder and run Ant.

In my case (I'm using CSSLInt with node.js) I just copied csslint-master/build/npm/lib/csslint-node.js file over the version in /usr/local/lib/node_modules/csslint/lib/. All was working as expected.

I'm curious if JSLint/JSHint can be used this way as well.

Posted in a note to self, CSS, javascript Tagged ,

siteResearch

siteResearch is a project that I’ve been working on for a long. It’s main goals is to give you insight into the setup of your site. It tries to give answers and explanations about:

  • the inner linking of your site,
  • SEO
  • and how valid your html, css and javascript really is.

Requirements

The tools can be launched from the command-line and are written in PHP 5.3.
They use a MySQL database to store results (we use PDO so other databases should be easy to support).

The code is not optimized for security and should not be executed on a production environment. Crawling and parsing html takes to much resources for a production server. Besides that, not having to worry about security, gives me more time to work on useful features. A setup with XAMPP, WAMP, MAMP is ideal. (I also use MAMP & XAMPP to do my testing.)

At the time of this writing the project includes a crawler with:

  • a set of filters to remove unwanted results
  • an option to export the crawl results to csv/excel

A detailed list of features can be found on the milestone page.

Downloads and Documentation

Related Blogs

  • Related Blogs on

Posted in MySQL, PHP, Uncategorized Tagged , , ,

Gridset: make your custom grids online

gridsetMark Boulton has just released his new tool
“Gridset”. It has taken some months to develop and is now in beta.

Gridset is not a bunch of code you download from Github. It’s a browser-based tool to create grid systems

The tool is fully configurable and allows you to create all sorts of grids. You are not limited to the standard 12 and 16 column grids.

For the past few years, the grid systems we’ve seem on the web have all been evenly spaced columns (usually either 12 or 16), and that thinking is now being applied to the latest crop of responsive grids. There is simply more to grids than 12 or 16 columns and Gridset is designed to allow the creation of many, many types of grid.

While you work on you grids, they can be saved for later refinement, reference or as a starting template for future grids.

Definitely a tool webdesigner/webmaster should check out.

Related Blogs

  • Related Blogs on

Posted in Uncategorized

a small post about installing Testswarm on MAMP

Kevin Nilson has a great presentation on testing. After watching it, I was tempted to install my own Testswarm (jQuery project).

It took me a while to get it up and running but I advise you to try it out for yourself. More info at Testswarm, intall readme.

If you have trouble with the install, check that:

  • the users table has the correct settings for the auth field. Mine was defined as binary. Changing it to varchar solved login issues
  • if you install into a “testswarm” folder, make sure that the htaccess file is also adjusted to that location

    => expl.RewriteBase /testswarm/

Related Blogs

  • Related Blogs on

Posted in Uncategorized Tagged , , ,