Whimsical.nu

Welcome to “Geek chick”

I've been making websites as a hobby since 1998, and I do it for a living. There's down-to-earth, from-me-to-you bits and pieces of the art of web-hobbying as well as other geeky thoughts.

Recap week: geeky things in 2010

GlassesEvery year, I try to give myself a gift. Usually that’s in the form of a big(-ish) “tech” thing; a laptop, a camera, an LCD monitor, that sort of thing.

In 2010, I didn’t give myself any of that. In 2010, I planned to get myself an iMac, but that didn’t happen. I spent my money on other, “bigger” things, and subsequently I did not have any budget left over to give myself the iMac. (I’m hoping to give myself the iMac this year, but with my finances at the moment, I doubt that’s going to happen.)

In 2010, I also lost my ol’ monitor. I don’t think it’s entirely lost, but it flickers every so often that I’ve just plain stopped using it. Maybe someone else can figure out how to fix it, but that someone isn’t me. Part of me says just give it to the recyclers who come by around once a month, and part of me says maybe someone will want to buy a slightly wonky monitor cheap and, if not fix it, salvage it. For now, it’s going in the storage room, because I don’t know what to do with it.

In 2010, I did buy a color printer, so I can do my own printing and also do a bit of bookbinding with my own printed paper, own designs, own whatever. I have not fully utilized it in 2010, that’s for sure, but I’m happy anyway with my li’l purchase. It’s already saved me a couple of times.

I also started to be more vocal about user interfaces and user experiences in 2010. I’ve always been very interested in how the web affects users, how it can influence people, but I think it was this year that I started gaining more confidence in my experience and knowledge. It was this year that I was really able to pinpoint what I wanted to do–not just websites, but what kinds of websites, what kinds of projects, what kind of experiences I wanted to create.

I think all those realizations are due in part to the support from my teammates and superiors, but also because in 2010, I started treating the web as a hobby again, like I used to do. I started taking this blog seriously, I reopened my portfolio. It wasn’t that I had more time, because I actually had less, but I made time for it, and that extra dose of creativity is reinvigorating me in other aspects of my life, opening my mind to more ideas and more experiences.

2010 was an interesting geeky year. No new geeky toys, but a lot more geeky experiences.

This week is recap week! Stay tuned for piecemeal recaps of how 2010 went for me.

0 Comments

Blogs vs brochure websites

Indisguise.orgOver the last few weeks, I’ve started reviving my portfolio, as it’s been sitting rather lonely for a while. I’ve realized, however, that it’s been a while since I’ve done a revamp of a non-blog website; for a while back (maybe three-odd years back?), non-blog websites formed the bulk of my designing and revamping.

I’ve realized that designing for non-blog websites is something I actually miss, as it is quite fun. I can compare blog vs “brochure” websites to something like making wallpapers vs making icons and avatars.

On the whole, blogs are fairly straightforward, with your focus on making sure that the content is well-presented no matter how long (or short) it is. You theoretically have a lot of space to play with and move about in, but you also have a lot of space to fill. You think about readability and getting the most fresh content out there.

Brochure-type websites give you a little more leeway with creativity on how, and how much of the content, to present. You theoretically have a more compact space, even if you don’t stick to a single-page style. You think about grabbing the visitor’s attention, in order to intrigue them enough to want to dig deeper.

I don’t know which I prefer at this point, but I know I’ve missed doing smaller websites. <3

1 Comment

Web accessibility

Accessibility signRecently, I had the opportunity to sit in a web accessibility sharing session with Victor Tsaran, our in-house web accessibility guru. I’ve always thought I tried my best to make sure things I could influence and create were accessible; but this was an amazing, eye-opening session.

You cannot fully comprehend how much web accessibility (specifically the lack of it) can impact your users until you’ve seen someone work it out. We all know about not using display: none because it won’t be available to screen readers, or labeling forms properly. We know about the alt attribute and the need to correctly mark up the page.

But personally, after actually seeing how someone who is reliant on screen readers browses the web, everything looks different, more meaningful, somehow. To me, it was something like the first time I opened up the HTML file regurgitated by Microsoft Word in Notepad: so this is how it is! Your HTML document is simply that: a document. It has meaning, it has structure.

  • A form without labels? “Edit text, blank. Edit text, blank. Edit text, blank. Choose one, popup button. Choose one, popup button. Choose one, popup button. Submit button.”
  • Page without headings? Endless tabbing through.
  • Non-descriptive links? “Click here. Click here. Here. Click here. This. Click here.”

A well-coded page? Simple, functional, easy to navigate, and beautiful. In contrast, a horribly-coded page was as painful as Internet Explorer 6 (and probably as painful to correct).

We had no video or recording of the session, but I found a youtube video that gives you an inkling of how screen readers work:

And I bring you a two interesting blogs on accessibility: AccessibilityTips.com and Web Axe: practical web design accessibility tips. I’ve known the former for a good while, and the latter just recently but quite immediately bookmarked.

So does that mean W.nu is accessible? Sadly, no. I will need to sit down and work this through, but what motivation!

0 Comments

Lorem ipsum dolor sit amet roundup

Quoth page settings and designers and developers, “lorem ipsum dolor sit amet!” There are a lot of available services to help you with your fake Latin needs. From those who swear by it to those who spurn it in favor of REAL text, there is a generator for everybody.

  • The tried-and-true lipsum.com generator. I’ve been using this for a long, long time. Aside from an explanation of what lorem ipsum is, you get to specify how many words/paragraphs/bytes/lists. Nifty!
  • Oh-so-shiny Fillerati. For those who spurn fake Latin, Fillerati allows you to choose or randomizes for you from a selection of classic books. Grabbing your text is easy–hover and adjust the number of words/paragraphs/etc and click to copy either plain text or marked-up text. Shiny, is it not?
  • Menu-bar goodness in LittleIpsum. A Mac OSX application that shows on your menu bar and gives you fake Latin at the click of the mouse! Currently only for 10.4 and below, but 10.5+ version in the works, apparently!
  • A dashboard widget to Loremify your work. Another shiny OSX tool that functions just with a click of a button.

I know, I know, all those apps were for OSX! Fine. Here is one for you Windows people: Lorem Ipsum Generator. Happy?

Of course, there are a lot of extensions available for Firefox, and there is one for Chrome.

0 Comments

WordPress page keywords and descriptions

These days, the page meta tags for keywords and descriptions are generally ignored for SEO, as search engines get more and more sophisticated and as people try and cheat rankings by padding their meta tags with words. I haven’t been paying attention to it myself, but that’s not any reason to get shoddy with meta tags!

Sometimes page descriptions do matter: they show up in search result pages, when sharing links in Facebook, and other small things. For a WordPress blog though, these aren’t usually baked in by default. Your keywords and description are actually your website’s description!

That isn’t very helpful when you’re sharing a link and a description of your whole blog shows up instead of what the link is all about. :/

So I sat down one day and tried to figure it out for my blog. Because of how my blog is set up, I wanted the following things:

  • Category pages should reflect keywords and description of the whole category.
  • Single post pages should reflect an excerpt of the post for the description, and post category and post tags for the keywords.

And here is my function. :)

function get_keywords_description( &$keywords, &$description ) {

    if( is_home() ) {
        // home page should have blog-wide description and keywords
        $description = get_bloginfo('description');
        $keywords = "list,of,keywords,here";
        return;
    }

    if( is_category() ) {
        //categories you actually want to track/"specialize"
    	$CATEGORIES = array( 3, 4, 5 );

    	global $post;
    	$categories = get_the_category( $post->ID );
    	$current_top_category = 0;
    	foreach( $categories as $c ) {
    		if( in_array( $c->cat_ID, $CATEGORIES ) ) {
    			$current_top_category = $c->cat_ID;
    			break;
    		}
    	}
        $cat_info = get_category( $current_top_category );
        $description = "{$cat_info->name}: {$cat_info->description}";
        switch( $current_top_category ) {
            case '3' :
                $keywords = "list,of,keywords,here";
                break;
            case '4' :
                $keywords = "list,of,keywords,here";
                break;
            case '5' :
                $keywords = "list,of,keywords,here";
                break;
        }
        return;
    }

    // not home page, and not category page
    if ( have_posts() ) : while ( have_posts() ) : the_post();
        $description = get_the_excerpt();
    endwhile; endif;
    rewind_posts();

    global $post;
    $tags = get_the_tags($post->ID);
    $cats = get_the_category($post->ID);
    foreach( $tags as $t ) {
        $keywords .= "{$t->name}, ";
    }
    foreach( $cats as $c ) {
        $keywords .= "{$c->name}, ";
    }
    $keywords = rtrim($keywords,', ');
}

Actual usage is pretty straightforward.

<?php
$keywords = $description = '';
get_keywords_description( $keywords, $description );
?>
<meta name="description" content="<?php echo $description; ?>">
<meta name="keywords" content="<?php echo $keywords; ?>">

It’s not as elegant as I’d like–look at those horrid loops, and the use of the global $post–so if you have any suggestions on how to make it better, let me know!

0 Comments

Dropbox love

I'm talking about: Uses for Dropbox

Pretty much everyone probably knows about Dropbox by now: an application that syncs files online and across pretty much any device that can take it. I’ve had it for quite a while now but have only really started to utilize it recently.

This isn’t really “new” technology, nor are they the first to do something like it. I’ve used similar programs before, most notably one with a cute pig as an icon! (Sadly, I don’t remember what its name was!) Dropbox doesn’t have as cute an icon, but they have adorable stick figures: that counts for something, right?

Dropbox's referral illustration

Dropbox's referral illustration

Like its predecessors, usage is simple: put a file inside the Dropbox folder, and it gets uploaded online. Going on another machine with the Dropbox client application, you also get the file there once the client has finished syncing with the servers.

I used to store just files in it: presentations, source code, and the like. But there’s a lot more to Dropbox, and here are five things I do with Dropbox.

1. Syncing browser bookmarks

I’ve started syncing my Firefox bookmarks across machines using Dropbox. There must be a nicer way to go about this, and I’m sure it’s right around the corner, but this way is just nice for me. I’ve never liked a lot of the bookmark syncing products out there because it hijacks my bookmarks toolbar, which I dislike. This way, it’s just…in the background.

However, there is one caveat here: make sure Dropbox has finished syncing to/from the server before you start Firefox or shut off your machine, as you can end up with inconsistent, conflicted files on your Dropbox and no way to determine which is the right file.

2. Syncing Adium chat logs

Yes, we start to see the power of symbolic links. Syncing Adium logs across machines is done pretty much the same way! The first time I did this, it took a while to finish uploading all of my chat logs, so be prepared to wait a while.

3. Syncing Terminal configuration files

Oh, absolute love. No longer do I have to worry about differing settings between computers–symbolic links and Dropbox has me covered.

[amari@amari ~]
 $ ln -s ~/Dropbox/Data/bash_profile ~/.bash_profile
[amari@amari ~]
 $ ll ~/.bash_profile
lrwxr-xr-x  1 amari  staff  38 Oct  2 16:39 /Users/amari/.bash_profile -&gt; /Users/amari/Dropbox/Data/bash_profile

I’ve done the same for some other config files, like my vim settings file.

4. Syncing Passwords across computers

Absolute godsend, this one. With all the online accounts I have accumulated over the years, it’s a horror trying to remember passwords; so having 1Password worry about password information and syncing is wonderful. I’ve never used KeePass, but I swear by 1Password.

5. Syncing creative work

Creativity does not have a set time: if an idea hits, I like being able to capture it. Being able to quickly write a note, a blog idea, a story snippet and file it away in Dropbox for later is an absolute godsend: two wonderful tools for me here are Scrivener 2 and Notational Velocity, both of which have syncing/saving abilities to external folders.

Scrivener 2 is currently in NaNoWriMo preview mode, as Scrivener 1 does not have this syncing ability built-in (although you can save your Scrivener file in Dropbox, of course). With the new version, you can sync to an external version and specify what format the file would be in so that you can edit it elsewhere and pull in changes as needed.

Notational Velocity is a handy notes-taker, which also has the ability to sync with Simplenote, along with saving/retrieving the notes in plain text format in a specified folder (which is great for syncing via Dropbox).

A parting word

Dropbox is awesome, but remember: Dropbox syncing is done online, and your files are put on the Internet (and versions are kept of it on Dropbox servers). While the syncing Dropbox does is secure, they are still a third party; so bear that in mind before syncing every single bit of your life.

1 Comment

Trying out HTML5 local storage

I decided I’d try out HTML5′s local storage after reading Christian Heilmann’s Smashing Magazine article on local storage. (Check it out, it’s worth it.) It’s always looked very intriguing, and the article reminded me to give it a whirl.

I’ve always wanted to have the slide-out tray menu on the left retain the visitor’s “setting”, but had no way of doing so reliably. One might say that using local storage is far from reliable, but it actually made sense: it would provide enhanced experience for those with newer browsers, but degrade with older browsers (read: just ignored). And I set off on making it work.

The end result is as you see it on the left, with the following piece of relevant code:

    var expanded = true;
    if( localStorage && localStorage.getItem('whimsical-tray') == 0 ) {
        expanded = false;
    }

    // some initializing of the animations and events

    if( !expanded ) {
        toggleCollapse();
    }

    Y.on( 'click', function(e){
        var storeVal = ( box.fx.get('reverse') ) ? 1 : 0;
        localStorage && localStorage.setItem( 'whimsical-tray', storeVal );
        toggleCollapse();
    }, '#nav-site-tab' );

Crazy simple, it’s almost too good to be true.

0 Comments

Playing with rotation animation in YUI3

I'm talking about: adding a custom animation type to YUI3, and IE's Matrix filter

A long time ago in a galaxy far, far away–well, actually, it was just during the Yahoo! Open Hack SEA held in Jakarta, Indonesia–one of the things I got caught up on was working with animations in YUI3–specifically adding a rotation animation. I was high on tea latte and from lack of sleep.

I’ve always meant to come back to it, make it work across browsers, package it up prettily sometime, but I’ve never been able to. This entry has been in the database ever since the hack day, actually. But never put up because I just couldn’t finish it.

But it feels like a waste to let the code (as hackish, and likely useless as it is) fade away, so I’m pushing on and publishing this post anyway.

Animating the element

I wanted to follow as closely as possible whatever convention was used in YUI3, and as such I wanted the code to animate go something like:

YUI().use( 'anim-rotate', function(Y){
    var rotateAnim = new Y.Anim({
        node     : '#rotate',
        from     : { 'rotate' : '0' },
        to     : { 'rotate' : '180' } // we turn #rotate upside down
    });
    rotateAnim.run();
});

The question was, how? It was actually pretty straightforward after I’d taken a look at some code. I needed to add a “rotate” behavior to Y.Anim. Y.Anim.behaviors contain functions that determine what styling changes happen on each “stage” of the animation via the set() function.

Firefox and Safari have -moz-transform and -webkit-transform and they work well, accepting numeric inputs which is pretty much what I needed in order to have Y.Anim calculate the steps needed.

However, Internet Explorer’s BasicImage just doesn’t play nice; it rotates only in 90-degree steps. *throws random stuff at IE* This article discusses an IE implementation that works in increments, but when I tried porting over to the script, it ended up doing rather odd (funny!) things. You can observe the funny sample here, and see for yourself.

I spent two nights trying to figure out exactly why IE was doing this weird flipping out thing: the math was correct if I used a calculator. Rotating the image manually in increments using DXImageTransform.Microsoft.Matrix was working without any of the weird flipping.

Finally, I tried looking at the exact values that were coming out of Math.cos() and Math.sin(). It was usually correct–until the animation gets to 90degrees, 180 degrees, etc.

The culprit

Math.cos() and Math.sin() accepts values in radians, not degrees. So I needed to convert them (degree * Math.PI/180) and then perform the appropriate function. And Math.cos(90*Math.PI/180) is not 0, but rather, 6.123233995736766e-17.

And no, there is no way to round it up to a more moderate value. Math.round() rounds to the nearest integer, not some-decimal-place-I-want.

Yep, boys and girls, they are splitting hairs somewhere.

So apparently, it wasn’t an IE issue. This value came up in all the browsers I tested. IE’s “mistake” was in not giving us rotate() like the other browsers, but I suppose they have better things to do in their time than make things rotate (which is likely for the best…).

In any case, here’s the code I used. Maybe some IE developer will see this and make things work somehow ;)

A quick disclaimer: it’s a hack, and not even cross-browser.

YUI.add( 'anim-rotate', function (Y) {
    Y.Anim.behaviors.rotate = {

        // this function changes the style of the node/element
        set: function(anim, att, from, to, elapsed, duration, fn) {

            // get the actual degrees to rotate the element
            var v = fn(elapsed, Number(from),  Number(to) - Number(from), duration);

            // now set the styling
            anim._node.setStyle( 'transform', 'rotate(' + v + 'deg)' );
            anim._node.setStyle( 'webkitTransform', 'rotate(' + v + 'deg)' );
            anim._node.setStyle( 'MozTransform', 'rotate(' + v + 'deg)' ); // FF 3.1+ only :(

            // IE stuff; doesn't work as intended :P
            var deg2radians = Math.PI / 180;
            var rad = v * deg2radians ;
            var costheta = Math.cos(rad);
            var sintheta = Math.sin(rad);

            var m11 = costheta;
            var m12 = -sintheta;
            var m21 = sintheta;
            var m22 = costheta;

            var str = "progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand' M11="+m11+" M12="+m12+" M21="+m21+" M22="+m22+")";
            anim._node.setStyle( 'filter', str );
        }
    };
}, '0.0.1', { requires: ['anim'] });

Again, I have the full code I used up here, if you wanted to check out the oddness of IE as well ;)

0 Comments

Network names FTW

I'm talking about: amusing network names

I’ve always been interested in, well, interesting network names, and look down at all the boring “Linksys” and “2WIRERANDOMNUMBERS” networks found all over the world.

But why not change it up a little?

  • Back when I was working for STORM Consulting and we were very much a startup, Pao and I worked in Peter’s condo, which was on the 20th floor. Of course, the network name was “STORM”. After a while, we noticed that one of our neighbors had named his network Clouds. We don’t know if he thought we were being cheeky with connecting to [the] storm, but certainly connecting to clouds was as cheeky can be.
  • In the same vein, a current neighbor has selected the Universe to be where he’s getting information from.
  • When we finally went wireless for the house back in the Philippines, we thought for a good while before we finally opted to use No connection available. I don’t know if it fooled anyone.
  • I once found a network named Turtles. I sure hope it wasn’t indicative of the download rate!
  • When I finally got my internet connected at my new place, it was tough deciding on what network name to use. Finally, I am now connecting to Teh Intarwebz.

What’s yours?

0 Comments

A happy webmistress is a…happy webmistress

I'm talking about: W.nu layout

I think I’ve finally found the whimsical.nu layout that I will keep for a while yet: this one. One that I won’t want to completely redo after two weeks, one that I don’t feel like cringing at after an appropriate time has passed. Better yet, I not only still like it, but I like improving it.

Previously making blog themes for me has been “code it, put it up, stare at it for a while, want to revamp; rinse and repeat”. Once a layout was up, it was up. That was it. I’m happy that this one isn’t. That while it’s “done”, I see places where I can improve it, not because it was bad in the first place (okay, not everything is not-bad) but because it would just plain be nicer that way.

A living layout.

Since its birth:

  1. I’ve realized that that there’s a reason blog posts are in narrow format: it’s easier to read thinner blocks of text. (It’s the same reason newspapers use columns, I suppose.) So, I’ve expanded the w.nu tray by default instead. I’ve added the “+/-” indicator to show/hide the tray (instead of just a plain “+” always). I’ve changed the tray slide-put experience to also thin the content column (as that was the whole point of it).
  2. I’ve changed the header around: now, if you’re viewing a single post or a category, you’ll see a heading specific for that (post’s) category with a short description. Otherwise, you’ll see a generic “hello there” message with a brief category list. This helps not just to place the visitor, but also say, “hey, this is a standalone category if you want to follow just this one, but there’s more if you like!”
  3. I’ve changed the look of the comments. To be honest, I still don’t like it :/ I can’t decide on what kind of look I want it to have, actually. The study didn’t translate so well with actual comments (groan). It’s clunky and inelegant. So you’ll probably see it changing a couple more times.

/bow

0 Comments