29.10.13

life recently in pictures

Or more appropriately.
In little Tumblr images with the hashtag #quotes.

4x4

four quotes I'm wishing isn't true or is easier to follow.




four quotes that are true and (I'm extremely grateful that it) will always be.

28.10.13

HTML/Javascript: Make all your tables sortable

In my field of uhmm.. "expertise", it is normal to receive user requirements that are.. excuse me for using the term... "demanding". They would remind me that I (the technology) should always adjust to what they want. And I will probably forever be like, well okay totally can do that! I am a programmer by the way. But no, I'm no geek. Well, a bit, but not like those from (or some place as big as) Google. Those "people" (if they still are) who I admire A LOT. You see, admittedly, I'm a lazy arse. And when I "receive" a certain request, I tend to "Google" than "create" a solution on my own. So imagine the help I get from this bunch of geniuses all over the net! Including this.


MAKE ALL YOUR TABLES SORTABLE by Stuart Langridge.

I am just going to mention a few lines from the article, because yes, my arse really is that lazy.
"
if you saw that table in a client-side application, you'd expect to be able to click on the headers and have the table sort, would you not? I know it always annoys me when you can't. A fair few web applications do allow this; most of them, which are pulling this data by submitting a SQL query to a relational database (an environment eminently suited to tabular data) implement this by resubmitting the whole page with something like ordercolumn=4 in the URL, and then adding an ORDER BY clause to their SQL query to return the data from the DB ordered by the specified column.

Resubmit the page? Just to sort data we already have? I'm sure we can do better than that.

Now, how to use it. To make a table of your choice sortable, there are three steps:
  1. Download the Javascript library
  2. Include the Javascript library, by putting a link to it in the HEAD of your page
  3. Mark your table as a sortable one by giving it a class of "sortable"
"
It was pretty easy, that I was so amazed, that I had to share. Thus this post.
Tadah! And that's it. Let me end this with a quick note to Mr. Langridge.

TO STUART,

THANK YOU FOR BEING THE BRAIN BEHIND OUR LAZY ARSES.
JUST.
THANK YOU.

LOVE, ONE OF THE LAZY ARSES.