Paste Email Plus - perfect for multiple text snippets in Firefox

I've found recently when commenting on various blogs that I want to add a little footer to the comment with my name and blog address. For one or two comments typing it out by hand is fine but after a while I decided to try and find an automated way to deal with this issue.

So I was looking for something that allows me to enter multiple lines of text and then very easily insert this text wherever I choose. Well I quickly found the perfect solution - a Firefox add-on called Paste Email Plus by Chuck Baker.

You simply open the Paste Email Plus options window, enter a 'Label' to help identify this text, then enter the multi-line text in the 'Pastetext' field and click 'Save changes':




You are now set up and ready to start pasting that text snippet, in any area where you would normally type text just right-click and select 'Paste Email Plus' (below 'Paste' on my system) and then choose your labelled snippet:




You will now see your text chunk pasted into the text area wherever your cursor was at the time of the right-click!

Technorati Tags: , ,

JavaScript splits & matches with regular expressions (regex)

I had been developing some client-side validation code in jQuery/JavaScript and using Firefox (and the excellent Firebug) to test and debug it. I was then asked to ensure that it worked in IE6 & IE7 and that's when the problems started.

Apart from the usual "which file does that line number equate to, and why does it not tie up?" issues I found that IE doesn't like taking a regular expression as it's parameter to the JavaScript split function. Firefox will happily accept this and works fine but IE doesn't. After some searching it appears that Firefox might be the odd one out and that it's non-standard to pass in a regex.

So what do you do if you want to split up a string based on a regular expression or rather a rule that can't be simply expressed in the way that the split function wants it? Wouldn't it be nice if you could ask if a string matches a regex but then use certain matched bits of the string in your next few lines of code?

Well you can, simply use the match method, surrounding the bits of the regex that you want to use later in parenthesis '(' and ')' and then you can use the global JavaScript variable RegEx to pull them out.

So if 1234-ABC is your text, and you want the numbers as one part and the characters as another then you would use this regular expression to match on: ^([0-9]*)-([A-Z]*)$. You can then get hold of the matched numbers bit with RegEx.$1 and the letters bit with RegEx.$2.

var productCode = "1234-ABC";
productCode.match(/^([0-9]*)-([A-Z]*)$/);
var numbers = RegEx.$1;
var letters = RegEx.$2;
Technorati Tags: , ,

How to disable the auto-completion 'bell' in Cygwin (using RXVT)

If you have ever hit TAB a few times in bash (via RXVT) you will probably be greeted with the loudest 'bell' your PC can muster. After a while this gets pretty annoying so here's how to disable it if you are using RXVT inside Cygwin (this might work for other Cygwin terminals, I've just not checked)

Navigate to your home directory (normally just by typing cd and either edit or create a file called .inputrc

Add the following lines to the .inputrc file:

# Disable the annoying bell
set bell-style none
Save the file, close the terminal and reopen - you should now be bell-less!

Technorati Tags: , ,

How to get Scala working with the RXVT terminal on Cygwin

Out of the box Scala support Cygwin, but this is only with the Windows command prompt-based bash terminal. If you have opted for the more UNIX-like terminal of RXVT then you will find that although the interactive Scala interpreter runs, you can't get it to do anything!

This has been raised as a bug (Ticket #2097) against the Scala project and graehl even posted a patch to changed the generation of the scala runtime scripts.  As my Scala install was based on the downloaded Windows binaries (scala-2.7.6.final.zip) I couldn't directly use this patch, but I could examine it to see what graehl's fix was.

It appears that the key bit was to add the following Java command line option to the java statement that starts the scala interactive interpreter:

-Djline.terminal=jline.UnixTerminal
So the last line of my bin/scala file is:
exec "${JAVACMD:=java}" $JAVA_OPTS -cp "$TOOL_CLASSPATH" -Dscala.home="$SCALA_HOME" -Denv.classpath="$CLASSPATH" -Denv.emacs="$EMACS" -Djline.terminal=jline.UnixTerminal scala.tools.nsc.MainGenericRunner  "$@"
This appears to work, my interactive environment is now interactive!

Technorati Tags: , , ,

Tommy Emmanuel being VERY creative with an acoustic guitar and some clever delay

I don't often post about guitar stuff as I really want to keep this blog focused on the tech side of my life but I couldn't help but pass this YouTube link on:

Delay (& Creative Uses for It)

I started to watch it and was soon completely captivated by it, hope you like it too!

Technorati Tags: , ,

The next Manchester Spring User Group meetup is 13th October

Details of the next Manchester Spring User Group meeting are now available, as a taster for what it could be like I blogged about the last meeting. It looks like the main talk is going be from Jonas Partner on Spring Integration.

It's a 6pm start in the usual place (there's a lovely space-age building where the building site is on Google maps...) Remember there's free parking if you pull up to the barrier and mention the Spring User Group.

Hope to see you there - if you see a skinhead with glasses please come over and say hello! Oh and make sure you register to be guaranteed entry!

Technorati Tags: , , , , ,

Use Pidgin? Send screenshots with this great new plugin!

I've been a big fan of Pidgin (formerly Gaim) for the past few years and one feature that I've always wanted was an easy way to send a screenshot to a buddy.

Well Raoul Berger obviously wanted it too and he's gone and developed the excellent 'send screenshot' plugin. Download and install it and make sure you have enabled it:


Then you can right-click and buddy in your buddy list and choose 'Send screen capture...' - your screen then darkens and you have a crosshair with which to select the region that you would like to send to you 'buddy':


You can also send a screenshot within a existing conversation by choosing the 'Convesation' -> 'More' -> 'Send screen capture...' option:



Another and fast, better way is to ensure that you have 'Show detailed information' selected in the 'Conversations' tab of the preferences and then you can simply right-click on the person's banner and select the option:


Also, after an email conversation with the send screenshot plugin author he's mentioned that he's looking to add a keyboard shortcut in the next release, which will make the whole process even slicker!

This is a great plugin and thanks to Raoul for taking the time to develop it (for a number of platforms I may add).

Technorati Tags: , , , ,

You NEED an X-mini II speaker for your MP3 player or iPod

My wife was looking around for an external speaker for her MP3 player and in our searching we came across the XMI X-Mini speaker on Amazon. This little mono speaker has 105 five star reviews (out of 115) on Amazon and at the time was £20 (it's now £16.96 - was £15 for a short time).

It's an absolutely cracking speaker - the internal (rechargeable) battery lasts for hours and this thing can really pump it out - with the bass expansion chamber opened up it sounds amazing. We have used it as a speaker for an MP3 player as well as an output speaker for a guitar headphone amp - true rock guitar sound on the move!

If you are on the look out for a mini speaker for your MP3 player you will not be disappointed with an X-Mini!

Technorati Tags: , , , , ,