A Simple jQuery Print Page Plugin
Posted by Ian in javascript on February 26th, 2010
The other day I was after a really simple way to add a print page link to a page to, well, er, print it. So I came up with my jQuery Print Page plugin and stuck it on GitHub with a demo page: http://github.com/ianoxley/jqueryprintpage
This really is nothing fancy: it’s just a convenient way of adding an <a> tag plus an event-handler to a page to print it. Using it is as simple as, well, using File -> Print. But you can’t style the File menu with CSS so this is much more fun
What Makes a Good Printer Test Page?
I don’t normally think twice about printer test pages. And, to be honest, who does? But I was setting up a new printer at home the other day on my laptop, which dual boots into Ubuntu 9.10 (Karmic Koala) and Windows 7 and couldn’t help but notice that stark contrast between the Windows 7 printer test page and it’s Ubuntu counterpart:

Windows 7 printer test page

Ubuntu 9.10 printer test page
I know which one I find more useful and informative
How to check if an assembly was compiled in debug or release mode
I came across this nifty bit of code the other day when looking for a way to do this and, just for fun, thought I’d convert it to IronPython. So I did. And here it is:
import System
def is_assembly_debug_build(filename):
"""Returns true if filename appears to have been built in debug mode"""
result = False
dll = System.Reflection.Assembly.LoadFile(filename)
customAttribs = dll.GetCustomAttributes(False)
for att in customAttribs:
if att.GetType() == System.Type.GetType("System.Diagnostics.DebuggableAttribute"):
result = att.IsJITTrackingEnabled
return result
I saved this in a file called diagnostics.py. So using it (you’ll need to be in the same directory as diagnostics.py or have added diagnostics.py to your path – more info can be found here: http://docs.python.org/tutorial/modules.html#the-module-search-path) is simply a matter of doing something like this:
from diagnostics import is_assembly_debug_build is_assembly_debug_build([absolute_path_to_your_dll])
If you’re interested you can grab a copy of diagnostics.py from http://gist.github.com/206177
Have fun
A Meta Keywords Tag Does Nothing for your Site’s Google Rank
Are you fed up with so called SEO experts extolling the importance of meta “keywords” tags on a site’s Google rank? Me too. I therefore created doesgoogleusethekeywordsmetatag.com.
So the next time anyone moans about their site’s lack of a keywords meta tag, you know where to send them
Updating RubyGems on Ubuntu to Install Jekyll
Having recently read about Jekyll I decided to boot up Ubuntu, install all the bits and pieces and give it a try. However, I fell at the first hurdle when greeted by the following error:
Error installing gemcutter:
gemcutter requires RubyGems version >= 1.3.5
The Synaptic Package Manager reported everything as being up-to-date but only to version 1.3.1. As it turns out, there is another way to update rubygems on Ubuntu, which worked a treat! The rest of the installation was a breeze
If you are interested more info on Jekyll can be found on GitHub.
Recommended Reading for 2009-10-30
Posted by Ian in Uncategorized on October 30th, 2009
- LINK: Javascript for paging posts with ‘j’ and ‘k’
via Signal vs. Noise
- INSIGHT: UI that looked sexy in Photoshop almost always
via Signal vs. Noise
- What you buy when you buy a lottery ticket
via Seth’s Blog
- Add Reference Dialog Improvements (VS 2010 and .NET 4.0 Series)
via ScottGu’s Blog
- Dev Anti Pattern: Unworkable Machine
via Team Leadership
Lorem Ipsum Bookmarklet
I often use a couple of paragraphs of Lipsum when testing forms containing <textarea> tags and have had this bookmarklet I cobbled together sitting on my Bookmarks Toolbar for a while now.
Anyway, I thought it might be fun to hook it up to a HTML 5 form to let you customise how many paragraphs of Lipsum you want each time you click it. So that’s what I went and did:
Lorem Ipsum Bookmarklet Generator
Hopefully it’ll save you a few mouse clicks next time you’re testing some forms.
(Please note that the form used in the generator uses the <input type="range" /> HTML 5 tag which currently works best in the latest version of Opera. YMMV when using other browsers).
Nice UX on The Book Depository’s Payment Page
Quite often, when buying books off Amazon, you can sometimes get them cheaper by going to a marketplace seller’s own website. That’s how I came across The Book Depository, where I have bought a few books recently.
One nice UX feature that I like on this site was the way in which they highlight where to find your credit card CVV/security number depending on which credit card you are using:
The image above shows the security number highlighted on the signature strip when you select Visa from the credit card type drop-down list. Compare that with the screenshot below showing the security number highlighted on the front of the card when American Express is selected:
It’s a simple feature really, but nicely implemented.
Recommended Reading for 2009-09-21
- 5 ways to grow great developers instead of desperately looking for them
via Team Leadership
- Things to ask before you redo your website
via Seth’s Blog
- The priority list
via Seth’s Blog
- Tip/Trick: Increase your VS screen real estate by disabling HTML Navigation Bar
via ScottGu’s Blog
- How to find hidden problems in your project before it’s too late
via Team Leadership

