Improvised Web Delights

Design, UI, UX, and all things groovy by Eric D. Fields 

Moving to Tumblr (just like everybody else on the Interwebs)

I'm packing my Posterous bags and moving this show to Tumblr. Look for future posts at http://ericdfields.tumblr.com.

Why?
  • Simpler interface.
  • I'm more familiar with the templating framework.
  • I love the follow system. Many of the blogs I actually follow are already there.
  • It just feels more "fun."
  • Argyle & Gingham lives there.
I'm already importing this sites posts as links back to Posterous with summaries, which I consider just as smooth a transition as is truly needed.

See you there!

Comments [0]

Why Not Use Facial Recognition to Unlock Your iPhone?

… or any other phone with a front-facing camera (I guess…).

I've always thought that Android's unique gesture-based locking mechanism was cooler than the iPhone's simple PIN approach. But thinking about it a little more, it's just not cool enough for an Apple device. Wouldn't it be better if your phone could just "look at you" and, knowing exactly what you look like, let you in? Now, will the front-facing camera please step up to the podium?

Facial recognition systems are mature enough these days; hell, the technology is even bundled into lowly consumer applications like iPhoto. My developer senses that tell me it'd be more than feasible to shove that into iOS right now. Just imagine: wake the device up, click a button on the screen, and the device takes a quick look at you, figures out your key facial patterns and let's you in. Even if it takes just as much time to enter a PIN, this is a zero-effort approach.

Take it to the next level: give device access for up to 5 loved ones as well. It just feels like one of those "magic" features that Steve Jobs would love.

Of course you'll have to be able to fall back to a PIN for low-lighting situations, but no biggie.

Comments [0]

Magic Gmail drag and drop

Little known OS X/Webkit hack: you can drag files from the Desktop or Finder or anywhere they're draggable onto file fields rather than needing to go browse for it through an upload dialog like a sucker.

Chrome + Gmail one-ups this though:

Screen_shot_2010-05-20_at_10

Check out the attached movie to really get it.

I've tested this in Safari and it seems to be a Chrome-only maneuva.

(download)

Comments [0]

Scott fixes TextMate's slow-ass project search

I stumbled upon the fix several hours later after right-clicking on one of the video files in the project drawer. There at the bottom is a menu item you can select to make TextMate ‘Treat Files with “FLV” Extension as Binary‘!

So check your flvs, pngs, jpegs, etc… anything you don't want TextMate to search, flag it as a binary. I even flagged sqls. Project search now screams.

Thanks, Scott.

Comments [0]

Stupid-easy Ajax retrieval of #Drupal nodes via jQuery

Let's make this quick. 

Proposed UI: List of articles on the left side, content area on the right.

Desired behavior: Click an article in the list, load the content on the right.

Bonus: Append a hash tag to the URL for bookmarking. When a user hits a hashed URL, load the node in the content area.

Step 1

Build a View to spit out your articles. We'll need the node ID to retrieve our content, but maybe we'll be using pretty urls with the ID nowhere to be found, so let's use the data-* attribute of HTML5 to store the node ID. Here's a link to the field I created because posterous really doesn't like dealing with code: http://grab.by/3oAi

Step 2

Build your module:



 


<?php


// $Id$


 


/**


* Implementation of hook_init().


*/


function mymodule_ajax_init() {


drupal_add_js(drupal_get_path('module', 'mymodule_ajax') . '/js/mymodule_ajax.js');


}


 


/**


* Implementation of hook_menu().


*/


function mymodule_ajax_menu() {


// create query path


  $items['ajax/get/node'] = array(


    'page callback' => 'mymodule_ajax_get_node',


    'type' => MENU_CALLBACK,


    'access arguments' => array('access content'),


  );


  return $items;


}


 


function mymodule_ajax_get_node($nid) {


// get the node object


  $node = node_load($nid);


// render the node


  $view = node_view($node);


// return the rendered node as json


  drupal_json(array('status' => 0, 'data' => $view));


}


 


Step 3

Build out mymodule_ajax.js



 


Drupal.behaviors.thirtyeight_ajax_get_node = function() {


// so whenever there's data-nid on a node…


  $('a[data-nid]').bind('click', function(){


var nid = $(this).attr('data-nid');


parseUrl(nid);


    return false;


  });


 


var parseUrl = function(nid) {


// …do an ajax get…


$.get('ajax/get/node/'+ parseInt(nid, 10), null, function(data){


var result = Drupal.parseJson(data);


// … plop the resulting html somewhere (should be parameterized)


 $('#sidebar-left').html(result.data);


// … and update the location bar


location.hash = '#' + nid;


});


}


 


// check for # in the URL on load and grab and show the respective node


var match = /#(.*)/;


if (match.exec(window.location.href)) {


parseUrl(match.exec(window.location.href)[1]);


}


}


 


That's really the gist of it.

Consider this a framework. It will need to be customized to suit your needs. For one, you probably want to parameterize the eventual location of the returned node — I'm just loading it into #sidebar-left for testing. If you're going to use this on multiple sections of your site in multiple views, maybe set #sidebar-left to a variable that you define on the view itself. 

I'd like to make the back button work. jQuery History seems to have solved this problem using an invisible iframe, but its a bit out of scope for now.

Can you think of any way to make this even better?

Comments [2]

Track art is the new album art

I just downloaded the short & sweet EP from lo-fi upandcomers The Cults, and found this lovely treatment on all the MP3s:

Screen_shot_2010-03-15_at_1

Since the album format is pretty much dead (even Apple couldn't help much), this is an excellent way to breath some fresh visual identity into the sea of dismembered tracks in our music libraries.

This also means less sad blue eighth notes in iTunes. I've been a big fan of Grid View in iTunes since its creation. It lets you find your music visually. Sometimes this is not the most efficient way to find what you want to listen to, but its a heck of a lot more fun than looking through a spreadsheet seven thousand tracks. I even got upset when they wanted to make a white background the only option in grid view.

I might just be geeking out over this a bit too much, but maybe one day they'll be a piece of track art that will be just as iconic as some of the most memorable album covers of yesteryear.

Comments [0]

Take Ctrl of your Caps Lock

If you've learned any netiquette at all, you'll know that typing anything in all caps is the textual equivalent of shouting. And shouting is just as unhelpful online as it is in civilized human interaction. 

Since we don't want to shout, what good is a Caps Lock key these days? Other than creating some accidentally loud emails from Grandma, the Caps Lock key serves no function to the modern computer user. So why not re-map it? 

Screen_shot_2010-03-08_at_11

I've got mine wired up to pour me a glass of wine and prepare some hors d'œuvres. It's a little tricky, so I won't go into how I did it. 

But you'll get some extra convenience out of that defunct button simply by mapping it to a helper key, like Control. If you're a developer or designer or simply use a lot of keyboard shortcuts all day, you might find this being a more natural placement than the barely-pinky-friendly lower corners of the keys.

In OS X, System Preferences > Keyboard > Modifier Keys should look like the image above. 

So quit shouting and take ctrl. 

Comments [0]

Why does box-shadow affect the box model?

At least in webkit — I'm in a bit too much of a hurry to test Firefox right now — adding box-shadow to an element effects its overall width, busting up your design real good if you want to do something like cast a shadow on a block element that's the full width of the viewport. In the image below, I'll never be able to kill that scrollbar without declaring no oveflow:hidden on the body.

Screen_shot_2009-12-24_at_12

Can someone justify this to me and/or make me not hate it?

Comments [0]

It might not seem it everyday, but yes. Really.

A self.reddit asking "Americans: is it really that bad?":


I have to admit that the image I have of the US has become even far worse after I started to frequent reddit than it was before (which wasn't all that great either).

It seems you have a ridiculous laws (teens going to prison for consensual sex, weed-possesion can land you in jail); corrupt and violent cops; state-lawyers and judges who will protect said cops. It's basically a settled in, tax-funded mafia. It can protect you at times, but the risk to get fucked over is actually your main concern.

If you do get fucked over (or actually made a mistake.. like doing drugs) and end up in prison, it's a coinflip whether your life will be permanently destroyed there through violence, rape or other forms of abuse while guards and officials laugh at you.

Your two parties seem to be different sides of the same rotten coin while lobbyism is the main force behind politics. The first black president wins with health-care reform as his major inner-political topic and the lobbyists still manage to break the reform. You will probably still have to deal with a health-care system that can force you into bankruptcy (or death) more or less out of the blue.

Part of the reason for that is that one of the most popular TV-stations broadcasts propaganda that would make even Goebbels proud.

A president or minister doesn't have to fear to be prosecuted even if it's more than just likely that something was fishy during his term(s).

In school you might actually be thought creationism and you will probably be way behind most countries in quality.

Many of your cities are unsafe to the point that an American woman who visited my hometown of Berlin (which is one of the most dangerous cities in Germany) stated that she feels so much safer here.

What do you get in return for that? Maybe 1 or 2 cars more on average during your lifetime and more inches on your monitor.

Yeah I know, news tend to be bad, but it's just that the scandals are so frequent and have such a scale that I started to wonder if it is really that bad.

So, how bad is the situation really in the US?

Im about to take a look at the presently 644 replies. I can't say I'll know exactly what will happen after that. Join me: 

http://www.reddit.com/comments/agifw/americans_is_it_really_that_bad/

-- eric

Comments [0]

@apelad #iconoclasm

Some of the best artwork to come off the tubes. I'm sure you'll all agree.

Comments [0]