Convert HTML HEX code (#ffff00, etc) into RGB (255,255,0)

I recently needed to convert a HEX value in a database into a RBG (red-green-blue) value for using in some Javascript. I ended up doing it in the Perl code, as it worked out pretty simple: Then call with: This would convert the above into rgb(255,0,255) Enjoy! Andy I’ve been working as a Web-Design / [...]

Posted in Perl Coding | Leave a comment

 

“Search Auto Suggestion”, like Google

I was recently playing around with some code to make an “auto suggest” function for when people do searches / add values into an input field. Here is what I came up with: View the example Its pretty simple to setup: 1) Add in the jQuery library (if you don’t already have it!): 2) Add [...]

Posted in jQuery, Perl Coding | Leave a comment

 

Cleaning characters from a string, with 1 simple regex

I recently came across a nice regex function, which I didn’t know about. Normally, if I wanted to replace a selection of charachters from a string – I would simply do: But I recently found this can be achieved using a single regex: Basically, we are just “merging” those 2 queries into a single one, [...]

Posted in Perl Coding | Leave a comment