My favorite StackOverflow answer, translated for non-programmers

I found one of my favorite stack overflow answers of all time the other day.

Essentially, a less-skilled developer asked why his RegEx wasn’t parsing his HTML correctly. The answer, in short: Why in the world are you using RegEx to parse HTML? Don’t do that. But the delivery was phenomenal (seriously, go check it out). Continue reading “My favorite StackOverflow answer, translated for non-programmers”

An Explanation of Baseball for the Non-Sports-Inclined

Baseball is a game that was invented in America, known as “America’s Greatest Past-time”. In this game, there are two teams. During each sports interval, both teams get a chance to try to get points, and to try to stop the opposing team from getting points. At the end of 9 intervals (or 18 half-intervals), the team with the most points wins. Continue reading “An Explanation of Baseball for the Non-Sports-Inclined”

Your anonymous functions are bad, and maybe we can fix that.

Using anonymous functions for certain callbacks in JS is an age old practice, but it’s high time we all started doing things a little different

If you’ve worked in javascript more than a handful of times, you’ve probably seen something like this:

$elements.each(function (i, el) {
    var $el = $(el);
    $el.removeClass('mod-no-pointer').addClass('mod-label');
    $el.append($('<span class="icon icon-standard img-replace"></span>'));
});

This is technically valid code, and has been a common practice for some time. the $.each() method EXPECTS a function, so how else are we to do this? It gets even more complicated when we Continue reading “Your anonymous functions are bad, and maybe we can fix that.”

In this day and age, how is Java still confused with JavaScript?

Back in 1998, when I was only 15, I called into a Q&A style tech show on ZDTV to ask one question that was bothering me: What was the difference between Java and JavaScript. My call was never taken, and my question didn’t come up on the show, but I eventually figured it out on my own.

Many web developers over the years has bemoaned Netscape’s decision to name their new programming language JavaScript, which was apparently an attempt to bank off of the recent success of the Java programming language. It has since led to much confusion, but I had thought that anybody who was even remotely technically savvy would know the difference by now. Apparently I was wrong. Continue reading “In this day and age, how is Java still confused with JavaScript?”

Process Prototyping (a.k.a. the Bromander Method)

As a software engineer, I have found that I must continue to learn new tools and techniques to stay relevant (and engaged) in my field. I’ve had more than my share of dry periods where work seemed boring, until I was brought a challenge… something that I had no idea how to handle, which forced me to learn new methodologies to accomplish the task. These periods of sink-or-swim, grow-or-fall-behind (sometimes lasting months) are undeniably the most exciting periods of my career to date. Continue reading “Process Prototyping (a.k.a. the Bromander Method)”

A simple accordion with jQuery, without worrying about off-by-one errors.

As you may well know, it is common in web development to include accordion menus on websites nowadays. It frequently hear people mention around the office how they’re currently working on, “yet another accordion”. Reusable code libraries aside (i.e. saving your accordion code for reuse later), I also often hear people mention difficulties getting the correct accordion row to expand. Whether it is that ALL the rows expand, or the wrong row. Continue reading “A simple accordion with jQuery, without worrying about off-by-one errors.”

How the desktop notification saved the day (sort of)

I was sitting at work this afternoon, getting things done, when I noticed a notification pop up from the notification daemon I’ve been working on. It was for Google Voice (one of the types of notification requests I have written in so far), and read “MISSED: Front Door at Home (62 seconds ago)“. I immediately knew two things:

1. I JUST missed a call
2. That call was from the call box at my apartment, which meant I had just missed a delivery Continue reading “How the desktop notification saved the day (sort of)”

Social Notifier: Now with extra Google Voice and Gmail following

I decided this week that I wanted to add a few request types to the Social Notifier application I’ve been writing in Ruby for the past month or so. If you’ve been following along, it has previously supported following a twitter home feed, twitter list, or twitter search term.

This week, I decided to add functionality to check for new emails in my Gmail account and new text messages in my Google Voice account. Continue reading “Social Notifier: Now with extra Google Voice and Gmail following”

Twitter Notifier application for Linux in Ruby: Overhauled

Last month, I spent a weekend writing a short application to retrieve updates from Twitter and display notifications using libnotify in Ubuntu. Although it “worked” after that weekend, I’ve put a great deal of effort during my free time over the last month toward completely rewriting it to be much more of an application, instead of just a functional script.

Over the last month, I’ve made drastic changes and improvements to the functionality, the code structure, and have made numerous bug fixes. I might has well have ripped out its guts and started over, but it has been absolutely worth it. (code at the end of the post) Continue reading “Twitter Notifier application for Linux in Ruby: Overhauled”

Weekend project: A ruby application to pass new tweets to libnotify in Ubuntu

I was thinking on Saturday morning that it would be nice to have a way to receive ongoing notifications of new tweets while I’m running linux, without having to check my phone, switch to a browser or twitter application, or stop doing whatever it is I’m doing. My first thought was to create a bash script to work in conjunction with twidge, filter out the data, and pass it to libnotify via the command line, but it started to get a little more complex than I was intending. I had wanted the script to be simple, and twidge’s output wasn’t working with me. I decided instead to start over, using ruby to accomplish the same goal: Twitter notifications over libnotify. Continue reading “Weekend project: A ruby application to pass new tweets to libnotify in Ubuntu”