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

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!

Getting started with drush scripts

Drush .. scripts?  Like shell scripts?

What you're looking for is this drush command:

drush topic docs-scripts

I was really hoping to find something at the top of my search results for getting started with drush scripting, but alas, nada. I did come across a d.o issue thread between greg and moshe where I guess drush shebang scripting was first introduced. I love this community!

Solr Server, Index, Views, Search API, and big nasty errors when moving environments

Had some good work against Search API + Solr going locally, so I Feature-ized and pushed to a remote at Pantheon ..  . and crrhhkkkkkggghhkkttthbbbtt. 

What I've learned:

One line sed/grep to replace or remove all database table prefixes in your Drupal site dump

On an inherited project, firing up a new dev site in Pantheon, I have it in mind that I need to provide the Drupal mysql dump without the table prefixes this shared host user currently has.

  1. drush sql-dump > ~/migrate/site.sql

  2. sed -i 's/theprefix//g' ~/migrate/site.sql

  3. gzip ~/migrate/site.sql

Hope this works.  I mean, I hope this helps.

How to disable UX-debilitating sroll-to-zoom on Leaflet views maps

So you read about Leaflet maps smashingly wonderful features and settings (like scrollWheelZoom) and are wondering how to implement them in your Drupal leaflet views maps? Wonder no more!

TARDIS (of) a box! Cardboard box project in a day.

For something a little different, I thought I'd post about one of the fringe benefits of moving.

I hate moving, it's expensive, and it's wasteful.  However, a year later when we finally got around to emtpying one of the larger moving boxes (a cardboard, wardrobe box read: very tall, sturdy, and wasteful), the kids took to it immediately. Together, we splashed on a coat of blue tempra paint, and voila, a homemade TARDIS for the kids to enjoy! :D

Moving boxes make great toys and a super time machine!