Bronius Motekaitis on Twitter

Welcome to the homepage of Bronius Motekaitis

This site is to keep me up to date with myself, but you're welcome to follow along. Next time I go on a tangent, you may want to come with...

HyenaJS connector for MySQL for NodeJS - Error: ER_BAD_FIELD_ERROR: Unknown column '__parent__.id' in 'field list'

I might be the last person on Earth to have figured this out, but sometimes working in hyena I actually feel like the only person on Earth.  So here it is so share with me a couple weeks from now again:

npm test begets:

Error: ER_BAD_FIELD_ERROR: Unknown column '__parent__.id' in 'field list'

for a MySQL table that has no field called 'id'.  The secret is to define your schema as having no primary key with "{primaryKey: false}":

Drupal 7 Generating Meaningful Stub Content by modifying seeded values

You know about the power of Drupal Devel module and its devel_generate submodule. You may be giddy to see that it generates lorem ipsum generic images for your image fields as well.  Perhaps you already found the fantastic Devel Generate Image Sources module.  You also get some reasonable control like "how far back should the node be dated."

Image styles imagecache_actions to center a row of disproportionate logo pngs

Thought I'd share a winning recipe for vertically centering logos of different sizes in Drupal.  In this case, I've got a horizontal band of logos that, out of the box, would be vertically off center:

But isn't this much better?

How'd you do that B??!

Easily create an Add Another Node link to a Drupal View header or footer

You've got your View, maybe it's a list of articles, and you want to provide the user with an "Add Another" link?


<?php
$links = array();
if (user_access('create event content')) {
$link = l('Add Event', 'node/add/event',
array(
'query' => drupal_get_destination()
)
);
$links[] = $link;
}
if (user_access('create performer content')) {
$link = l('Add Artist', 'node/add/performer',
array(
'query' => drupal_get_destination()
)
);
$links[] = $link;
}
if (count($links)) {
print "

" . implode(' | ', $links) . "

";
}
?>

This provides two links. Stick it in a Views Header or Footer with PHP filter type. Adapt to your own needs.

Gonna have some fun now with new Drupal T-Shirts available at DrupalCon Austin 2014!

Kids: "HEeeeyy Drupal!"

"OH YEAH!" (in the voice of the famous and awesome 80s Kool-Aid man).

I had a wild hare and decided to put together some fun 80s-themed Drupal tshirts which will be available for sale online and at the DrupalStore at DrupalCon Austin 2014.  Come check it out, and tell your 80s friends!

Simply prepend Drupal theme_table() rows with $rows index

I wanted to most-simply make a CSV import-seeded array in a Drupal themed table for a preview. Then I was like, "Hey could I include the CSV line number (the array index) as the first column in the table preview?" Here's what I came up with:

Moving Drupal sites/all/files to sites/default/files

Quick note to say that yes it is possible to move an incorrectly configured sites/all/files into the normal, expected, best practice sites/default/files.  Here's how:

Chasing the bloat: Server hdd filling up to capacity with Drupal mysql replication binlogs

From the annals of "and exactly how did I for from Drupal develoer and site builder to server admin" comes this tale of a weekend gone to rot.

Short story: Looks like our MySQL binary log files are filling up and rotating out as they've been configured to do (1.1GB apiece), but our not particularly large nor heavily trafficked Drupal 7 site binlogs were rotating out ~10/day!  Do the math-- that's .. a big number of gigglebytes gone down the tube in a heartbeat!