Tuesday, February 12, 2013

My Mom was interviewed by SQLServerPedia!

My mom, Gina Walters, was recently interviewed by SQLServerPedia for her work on the Pittsburgh SQL Saturday.

You can read the article here. She makes some great comments about women in the technology field and what's involved in running a successful meet up.

Congrats mom!

Tuesday, January 29, 2013

Bootstrap Modal Double Backdrop

I recently had an issue where I was getting the modal-backdrop class applied twice, so I ended up with two overlays.

Symptoms

Upon calling .modal(), I ended up with a very dark background overlay. Dismissing the modal cause the overlay to lighten but remain. Clicking somewhere on the page or pressing ESC caused the overlay to vanish.

Method

This was occurring whenever I loaded the entire content of the modal with AJAX. Something like:


function makeModal(html) {
        var $modal = $(html);
        $('body').append($modal);
        $modal.modal();
    }

The problem is that html had a script tag present, so $modal.modal(); was actually being applied to the modal div and the script tag.

The Fix

You need to make sure you only apply modal() to the modal  div, like this:

function makeModal(html) {
        var $modal = $(html);
        $('body').append($modal);
        $modal.filter('.modal').modal();
    }

I found the answer to this problem via landon's post on this github issue: https://github.com/twitter/bootstrap/issues/679

Friday, January 25, 2013

Confluence: Failed to create the user X. Check your server logs for more information.

I recently received this error when trying to create a new user.

The error was occurring because of the order of my Group Directories.

I have both Confluence Internal Directory and Microsoft Active Directory enabled. The order is important here. Microsoft Active Directory was listed first, so when I was trying to create a new user it was trying to do so in AD.

In my case, I wanted the user to be created in the internal directory, not my AD.

The Fix


  1. Browse -> Confluence Admin
  2. User Directories
  3. Use the green arrows to make it so the Internal directory is first in the list.






You should now be able to create your user!



Tuesday, January 22, 2013

Get a Stack Trace on the Symfony2 Command line (console)

If you run a command via the Symfony 2 Console component and receive an exception, you aren't presented with much more information than the exception name and message.

To see a full stack trace, append -v to your command.

For example:

php app/console doctrine:schema:update --force -v

This will provide a full stack trace. You probably need to have Xdebug installed.

Friday, December 7, 2012

Symfony 2 cache and log permissions on Ubuntu

Using the ACL, run the following in your project home directory:


sudo setfacl -R -m u:www-data:rwx -m u:`whoami`:rwx app/cache app/logs
sudo setfacl -dR -m u:www-data:rwx -m u:`whoami`:rwx app/cache app/logs

More info at http://symfony.com/doc/current/book/installation.html

Tuesday, November 27, 2012

CSS, Sublime Text 2, Colon, Vintage Mode

Can't use ':w' to save CSS/LESS files in ST2 in Vintage mode because it keeps just inserting the colon? The problem is actually with ZenCoding keybindings.

Quick Fix

Add the following to your User Confirmation file, found via Preferences -> Key Bindings (User)


{ "keys": [":"], "command": "show_overlay", "args": {"overlay": "command_palette", "text": ":"},
        "context": [{"key": "setting.command_mode"}]
    }

Note: The above should be inserted inside of the square brackets ([]).

What's going on?

ZenCoding has a default key binding for ':' that doesn't really respect Vintage mode. You can see these bindings in Preferences->Package Settings->ZenCoding->Bindings->Key Bindings (Default).

The binding mentioned in the Quick Fix is a copy/paste from the Vintage package key bindings. What we're doing here is putting it into our User key binding file, effectively over-ridding the one from ZenCoding.


Sunday, November 11, 2012

Using services.yml instead of services.xml in Symfony 2

In my application's bundle, I recently wanted to switch from using an XML file to register my services to a YML file. There's more information about services here: http://symfony.com/doc/current/book/service_container.html

Here's how to do it.

Create the services.yml file in your bundle, probably in something like /src/Acme/DemoBundle/Resources/config/services.yml

Next, edit the bundle's extension file and change which services file gets loaded:


// src/Acme/DemoBundle/DependencyInjection/AcmeDemoExtension.php

namespace Acme\DemoBundle\DependencyInjection;

use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\Config\FileLocator;

class AcmeDemoExtension extends Extension
{
    public function load(array $configs, ContainerBuilder $container)
    {
        $loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
        $loader->load('services.yml');
    }

    public function getAlias()
    {
        return 'acme_demo';
    }
}


The main changes are:

  1. switching the XmlFileLoader to YamlFileLoader in line 14
  2. canging the file to services.yml in line 15