Monday, August 27, 2012

My Amazon Wish List


Selected items from

My Amazon Wish List

Lots of juice to power your gadgets during those long flights
If you have a compatible Mac get this and the Samsung SSD laptop kit for the best upgrade you can possibly get on your laptop!
Includes laptop upgrade kit accessories
This kit comes also with 4 rechargable batteries (2xAA and 2xAAA) and spacers to convert the batteries into C or D sizes
Hide your backyard and pool stuff in style
No, really, how cool is that?
Zap those flying bugs and reclaim your backyard!
Yes it is expensive as heck but this is a wish list right? :)
Get few of these and save energy (and $$$)
Helps you find the energy hogs in your house
Automate your house's cooling / heating
Set the temperatue with your smartphone
You should probably be extra careful shaving with this one
Is there any all-in-one better than this yet?
For the (weekend) handyman (wannabe)
This magical item not only gives you darkvision but if the need arises you can also use it as a club!
Hook this up on your living (or media) room HTPC and its "couch potato" time
Guess this is good for guitarists?

Friday, August 24, 2012

Translate your website with Google Website Translator

Oftentimes we want to support multiple languages in our websites. One "easy" way is to keep one separate resource bundle for each language we support, but this isn't as simple as it seems. First you need a tag / mapping mechanism to match labels in your pages with tags in the property files (frameworks like JSF already provide it) but then you need to maintain multiple sets of labels. Any new field / screen etc will require changes all resource bundles, which can quickly become a burden. In many cases this burden may be  acceptable in exchange for full control and performance, but in other cases we can use Google's Website Translator tool.

Follow these steps to find out how to easily include a styled language selector into your website, and to remove the Google Website Translator toolbar. I recently applied these steps in Eventfy and the final result looks like this:

eventfyEnglish

Wednesday, August 22, 2012

Hide input type file from older iOS devices

I recently added support for user image upload in Eventfy. You can find more details and screenshots here.

Safari mobile in iOS devices like iPhone and iPad do not yet support file uploads and render input type file disabled. It may change with the upcoming update to iOS 6, but until then our web applications must take that limitation into account.

I wanted to hide the file update controls in iOS and show a note in its place. Instead of checking the browser version I am simply checking the state of the input file, which may also cover other devices with similar limitations.

The code below describes how to set it up with jQuery, but it is simple to do the same with plain Javascript.

  1. HTML part:
  2. <div id="imageUploadDiv" class="control-group">
     <label class="control-label" for="imageUpload">Image</label>
     <div class="controls">
       <input id="imageUploadInt" name="imageUploadInt" class="input-file" type="file" />
       <p class="help-block">You can optionally include a picture or image in your invite</p>
       <span id="imgPreview" class="thumbnail" style="display:none;width: 250px;"></span>
     </div>
    </div>
    <div id="imageUploadiOSWarning" class="alert alert-info" style="display: none;">
     <button type="button" class="close" data-dismiss="alert">×</button>
     <strong>Note</strong> Image upload isn't supported by iOS before version 6.0
    </div>
    
  3. Javascript / jQuery part:
  4. <script>
    $(document).ready(function(){
        if ($("#imageUploadInt").prop("disabled")) { 
            $('#imageUploadiOSWarning').show();
            $('#imageUploadDiv').hide();
        }
    }
    </script>
    

In this simple example DIV "imageUploadInt" is presented by default. But as soon the document loads we check if the input file was automatically disabled by the browser, and if so we hide "imageUploadInt" and show instead DIV "imageUploadiOSWarning".

Note: this DIV structure and CSS classes are defined in Twitter Bootstrap. You can find more about Bootstrap control forms here, on section 'Validation States'.

Update: I tested the image upload function in Eventfy yesterday (9/19) with iOS 6 and this code works great. Now users can upload pictures (if their device supports it), otherwise they are presented with a message explaining why the control is disabled.

Here are some screenshots to show how it works with iOS 6:

Input type file is enabled with iOS 6

Photo selection

Photo uploaded to Eventfy

Sunday, August 19, 2012

My Amazon Favorite Buys


A list of

My Amazon Favorite Buys

Read the disclaimer or check this list out and you may find something interesting
Great case for your small USB drive and USB cable
Small but large capacity USB drive, fast transfers and no separate power chord, excellent for backups
Note: they released a new version available here
Here's a relatively inexpensive item (compared to this one, that is) that can make a big difference when you're flying.
Tiny wireless N adapter
Tire inflator with a built in pressure gauge and adapters for bikes, balls etc
Quite noisy but strong enough for SUVs
Cool mist humidifier, good for those in dry climates
Works great with iPhones
Hook up 2 computers to the same monitor, keyboard, mouse and audio
Worked great with my URB keyboard and mouse
Find those da$% scorpions! Or check out CSI-style how clean your hotel room really is, it may surprise you
This is one of those things you never need... until you need it, that is!
More HDMI ports for your TV
Switch inputs automatically so you don't even have to use the included control
Good UPS for computers
Get this if you want extra time to save your work during a blackout, or to ensure a graceful shutdown if you hook it via USB
Don't use it very often but has a good price, looks great and so far it worked for years without problems
Nice gift for the wife, it looks great (on her, that is!)
Great radio for the bathroom countertop. I wouldn't keep it in the shower like some people at Amazon though
If this one is OOS you can find a similar version here
Best kitchen (or general purpose) radio ever, great quality sound and design
Excellent classic D&D game for under $10. If you like D&D and CRPG but you never played BG2 do yourself a favor and get it now. Great stories with an amazing replay value
Amazing board game set on the Game of Thrones' universe
Broom? What broom? Every house should have one of these
Note: this product doesn't replace a full blown vacuum
I bought 2 more expensive ones (the most expensive from Norelco and one from Wahl) but ended up coming back to this cheap one
This compact fabric steamer worked so well for my sister-in-law's wedding the whole family used it. So much so they kept it as a "gift" and we now gotta buy another one for the next weddings
Great gift for babies, it plays different sounds and songs in English and Spanish
Hands free soap dispenser. Get it for the kitchen and the bathrooms
Gift
Gift


Disclaimer

I purchased all items on this list either from Amazon or from other merchants and I am very happy with them. I am sharing this list so that if you buy anything you like here there will be a (tiny) smaller chance for them to be taken out of the market. However, your own experience with these products may differ.
I found that in most cases Amazon has the best prices or is at least close. You may want to check it with Google Shopping, other price comparison tools or in deal sites like Slickdeals. Still, Amazon reviews are great to help you find your own great buys, even if you buy elsewhere.

Friday, August 17, 2012

This blog is back

After a (too) long hiatus I finally decided to get rid of the cobwebs and write here again. I didn't have lots of cool ideas to discuss so I decided to start a new pet project to give me some inspiration. After few weekends this is what I came up with:
  1. Eventfy (http://www.eventfy.com), a simple web tool to setup events. You can use Eventfy instead of group emails to organize and track events. You can even setup conditional events like those poker (or RPG) games you can't confirm yet because you're not sure enough people will show up. In this case, once enough people confirm their presence Eventfy automatically notifies everybody that the game is on. If not enough people confirmed by the deadline you set Eventfy sends an event cancellation note to all invited. Thanks to responsive design techniques all functions work great from computers and from small devices like smartphones and tables.
  2. Pingr (http://pingr.eventfy.com), a basic web-based availability monitoring tool. Just enter a URL from your site and Pingr will monitor it for you. If the site goes down or performance (ping or download speed) drops below normal thresholds it will quickly send you a notification.
  3. Eventfy Blog (http://blog.eventfy.com), where I will post updates about anything hosted in the Eventfy.com domain.
These are quite simple projects but they are mobile-friendly (the screens won't look crappy on smaller screens and as such users won't have to zoom in / out in iPhone and iPad) and  it can transparently scale to meet the demand (hosted on Google App Engine's PaaS solution).

Check out after the break all the different topics I am planning to discuss here soon, all inspired from my experiences with Google cloud platform, public internet domains, responsive websites, HTML5, Twitter Bootstrap, jQuery and more.