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...

After replacing iPhone 5 battery and camera, the camera would not could not focus

I had disassembled my iPhone 5 to swap out its camera and battery according to this simple video. Without much fuss (except having accidentally broken the coax cable connector for the cellular signal antenna wire:

iphone tiny coax cable connector

HyenaJS connector for MySQL for NodeJS - Error: ER_BAD_FIELD_ERROR: Unknown column '' 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 '' 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?

$links = array();
if (user_access('create event content')) {
$link = l('Add Event', 'node/add/event',
'query' => drupal_get_destination()
$links[] = $link;
if (user_access('create performer content')) {
$link = l('Add Artist', 'node/add/performer',
'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: