pancake theorem a tech/life blog


Monthly Archives for March 2012

What to do if your Tumblr theme "does not allow" ask boxes. 03.27.2012

All Tumblr themes allow ask boxes, folks. The issue is that not all themes have the link to the Ask Box – which is always http://example.tumblr.com/ask (replace example with your Tumblr username).

In order to add the ask box link to your theme, you need to actually edit the HTML code. Don’t worry, though, it’s quite simple.

{block:AskEnabled}
   <a href="/ask">Ask Me Anything</a>
{/block:AskEnabled}

Not to get too in-depth about Tumblr theme development, the {block:AskEnabled} block tells Tumblr that anything between that and the ending {/block:AskEnabled} block should be visible only if you have the Ask Box enabled in your settings. In this snippet, the HTML for adding a link to the ask page is what will be visible. If you don’t have the Ask Box enabled in your settings, then none of this will show.

Put this code in your template wherever you want the link to show up in your theme, and you’ll be good to go. It’s a good idea to copy and paste your theme code into a text file before you make changes – that way you have a backup in case you royally screw up (lord knows I have before).


Prevent users from prematurely submitting data in your form using jQuery 03.26.2012

I developed a site that was just released to a small number of beta users. It required the collection of data, and some users would prematurely submit the form by hitting their enter key – which triggers the form’s submit button. Proper validation made sure that we received the required data, but it didn’t give the user a chance to provide non-required data.

For example, let’s say you have a form with one text area and a submit button.

<form>
   <label for="name">Enter your name:</label>
   <input type="text" class="text-input" name="name" />
   <input type="submit" value="Submit your name!" />
</form>

If you have one text input, then preventing a premature submit is not a problem. Let’s say you have 10 text inputs, not all required, though. Even if data is not required, you don’t want to take away the user’s chance of entering it. Non-required doesn’t necessarily mean not useful; in that were the case, we wouldn’t even have those fields in the form.

Fixing this is easy, though. You just prevent the default action of the carriage return key (character code 13) from happening.

$('input.text').keydown(function(event){
   if(event.keyCode == 13) {
      event.preventDefault();
      return false;
   }
});

I made sure to do the keydown() call only on items with class=”text” because I don’t want to take away the keyboard’s ability to submit the form if the user tabbed over to the submit button. I want to make the form more accessible to the user, not less!

Here is a nice, clear list of character codes, such as the 13 I used for the carriage return.


SimpleSlides 03.23.2012

This week I gave a presentation to students on advising and other info. During my lunch hour the day before (the only time I’ve had to breathe all week since we have faculty candidate interviews for what seems like forever) I built a simple HTML/CSS/jQuery slideshow framework. I mean, I guess you can call it a framework – it’s a single html document.

Because of its simplicity and its being a set of slides, I call it SimpleSlides.

It has everything: click navigation, numerical slide tracking, ← → keyboard shortcuts, subway sleeping bags, and the natural ability to fully customize it – it’s just a web page!

Get it on Github.
View the source for documentation.
Make some slides.
Present said slides.
Bask in thunderous applause.

I’ve tested it on Chrome Canary on Mac, IE8/9, and gave a presentation built on SimpleSlides using my iPad. Let me know if you run into any issues; at its original state, there isn’t much old-browser-unfriendly elements.

Update: Version 2.0 released on May 9, 2012. You no longer need to add slide position numbers to each side’s id attribute!



Stephanie Rieger: The Best Browser is the One You Have with You 03.15.2012

“Don’t prevent mobile users from accessing your desktop site.”

Ugh! I hate when a mobile site doesn’t let me access the desktop version!

Rieger also notes the annoyance of sharing articles from a mobile device. It’s not uncommon for someone to send me a news tip from a mobile site, and it shows up all wonky on my desktop browser. Of course, I do not share it because there is no easy way to get to the desktop version of said article.

I think this is something all site developers think about already. If you don’t, then you’ve got some reading, learning, and ‘splaining to do.



Mark Bittman: The Human Cost of Animal Suffering 03.14.2012

I like Bittman’s position on the treatment of animals in slaughterhouses, not just because I’m a vegetarian, but also he doesn’t lecture the reader and demand they stop eating meat entirely; he just wants them to eat less.

Another great point Bittman brings up is how humans separate themselves from the slaughter process and, therefore, many do not think of the cruelty when they’re eating the product of it – the programmer in me thought of encapsulation, which slaughterhouses obviously implement by keeping the killing to only a handful of actual employees.

Do I think there will ever be a time where people stop eating meat? I don’t know. I think we need to learn to stop making decisions about how other people live or die (women’s health, military practices, etc) first, before we can ever learn to stop making decisions about how other animals live or die.


I’m not a “curator” 03.12.2012

This. This. This.

I understand the idea of standards and their importance in media; I just don’t understand why would anyone want to confuse their readers by preceding attribution links with symbols better left to be used by musicians temporarily without a name.

Also, I still don’t understand the difference between “hat tip” and “via.”


“Homeless-powered wi-fi hotspots at SXSW” 03.12.2012

It’s been all over the blarghs (blogosphere 2.0) that a marketing company enlisted local homeless people to become 4G wi-fi hotspots around the SXSW area. People who want to get connected pay the human hotspots to do so. All the money you pay to connect to the network goes to the guy you’re paying.

Of course, being that this project is backed by a marketing company, the media is writing the story as if humans were trafficked into Austin, Texas, and forced to be the Internet for a few days.

Since when was it uncouth to hire someone who is otherwise unemployed?

Why is the media calling this “homeless-powered,” like people without homes and/or jobs are a renewable energy source?

The people who are acting as hotspots just happen to be homeless, and this is a real source of income for them. When you pay to connect to their network, you’re paying them, not a marketing company.

I don’t understand what the problem with this is.

(via Kottke)


You can Yo your own way 03.07.2012

Warning: I only wrote this so I can make a yogurt + Fleetwood Mac pun. Success!

There’s this new coffee and frozen yogurt place in Montclair called Let’s Yo. It’s the perfect place to go when you want to have a somewhat healthy dessert AND feel like you’re trapped in an Apple iChat-themed vortex to the sounds of Maroon 5. The only thing I can think of that’s like this place is the first Power Rangers movie.

I was intrigued by their drive to be tech-savvy, and to see their wide selection of toppings. I also wanted to try their coffee and see if it could be our new after-work-coffee-spot since our favorite place recently closed. The people who work there were very helpful, and probably weirded out by how confused Jimmy and I were by the whole thing. Sometimes I forget how out of touch with reality I am.

Thank god they have Angry Birds, right?

It’s a pretty high-tech place with iPads on every table, a big screen monitor showing their Facebook page, and a touch-screen coffee maker…

…which is cool if you like to watch your coffee buffer like a Playstation game. The coffee tasted like a Playstation game, too, whatever that means.

(It means it wasn’t very good.)

The iPads are filled with hilarious photos of kids and their dads.

This place is great for young kids and teens, and parents with young kids and teens. Jimmy and I do not fall into either of those categories, so it was very weird for us to be there. Regardless, the yogurt I ate (sugar-free vanilla with strawberries, blackberries, and Butterfinger crumbles) was delicious and cheap, which is all that matters, right?

I give this experience 3 out of 5 iPads.