Google Now (Android) Home & Work Locations

google-now-cardsI just moved, and I noticed that all of my Google Now addresses were wrong (i.e. “7 minutes to home” was actually pointing to my old address).  I updated my Google Contact, but it didn’t seem to take.  It turns out you need to go to Google Maps and update it from there.

Click My Places and you should see Home and Work.  Click the downward pointing triangle to the right of each of these, click Edit, and enter your new address.

Google, if you’re listening, this should be more intuitive.  Why don’t those values get pulled from the Google Contact that I’ve identified as me?  Then just propagate those changes outward.

Komodo Edit/IDE Color Scheme Location on OSX

More for me because I have to look this up every time I need it, but if you’re trying to figure out where Komodo Edit (or IDE) stores its color schemes on OSX, it’s in:

`/Users/<username>/Library/Application Support/KomodoEdit/7.1/schemes`

Where:

  • `<username>` = your username
  • `KomodoEdit` = `KomodoEdit` or `KomodoIDE` depending on which one you’re using
  • `7.1` = the version you’re using

Also, I’m using a modified version of Solarized Dark (originally from we3geeks) which has better JavaScript color support and a few other tweaks.  To install it, just download the ksf file and drag it into Komodo.

Download Solarized-Dark-Modified

WordPress GG Twitter Widget

So I finally got around to officially releasing my first WordPress plugins.  The first one, which I’ve actually been using for a long time on sites I build, is GG Twitter.  The issue that I was having with off-the-shelf Twitter plugins was that they would just display an error message when they couldn’t connect to Twitter.  So mine stores the last known good tweet retrieval and displays that if a connection error occurs.  Mini-caching if you will.

I’ve also added various options to it that I haven’t seen in other Twitter widgets (though, really, I haven’t looked at that many of them).  So let me explain them in a little more detail.

Grinning Gecko Twitter Widget

Admin configuration screenshot for Grinning Gecko Twitter Widget.

Title:  This should be pretty self-explanatory.  The title that appears at the top of the widget.

Twitter Username:  Also pretty self-explanatory.  No `@` necessary.

Max Tweets to Display:  I’m noticing a trend here.  Self-explanatory.  How many tweets do you want to show in the list?

HTML for the View All Link:  This is the HTML (or just text) that will appear at the bottom of the tweet list linking to your Twitter page.  By default it just says “View All Tweets”.

Time Placement:  Lets you display the time of the tweet before or after the tweet itself.

Time Format:  Lets you format the timestamp any way you want, assuming you can decipher the PHP: date reference page.  The default format is Tue Nov 6th (as an example).  Putting something like `l, F jS @ g:i a` would display Tuesday, November 6th @ 1:30 pm.

Title Links To:  That’s the second plugin I just released.  More on that later.

I also wrap pretty much every element in its own class, so styling is easy without any hackery.

Download GG Twitter from WordPress.org

Fork GG Twitter on BitBucket

Hooking into Widget Delete Action in WordPress

The title of this post is technically a lie, since there is no widget delete action (that I’m aware of anyway).  However if you want to hook into the action that occurs when a widget is deleted you can use the following code in your functions.php :

add_action( 'sidebar_admin_setup', 'my_sidebar_admin_setup' );

function my_sidebar_admin_setup() {

     if ( 'post' == strtolower( $_SERVER['REQUEST_METHOD'] ) ) {

          $widget_id = $_POST['widget-id'];

          if ( isset( $_POST['delete_widget'] ) ) {
               if ( 1 === (int) $_POST['delete_widget'] ) {
                    // Widget deleted; do something
               }
          }

     }

}

The ‘sidebar_admin_setup’  action gets triggered, seemingly, anytime a change occurs on the Widget screen.  Dragging a widget, saving a widget, deleting a widget – all of these trigger this action.  It’s a pretty handy hook to know.