Skip to content

Andy's blog o' goodness

php, web stuff, raspberry pi… even blacksmithing!

June 15, 2007

Slider – part 2 – using a mouse wheel

Following on from the previous post, I thought it’d be nice to have the handle move on a mouse wheel. Looking around for mouse wheel integration, it seems that it’s only a short amount of code to update Prototype to use the mouse wheel. Why it’s not in the core code I don’t know, as it seems rather handy. The...

Categories Experiments/javascript/Prototype Comments: 0
June 14, 2007

Scriptaculous slider trick

Yesterday I was looking at the Scriptaculous library, in particular the slider bar. I had used it once before with some success, using a graphic for the track and gripper. But that’s was boring! What I wanted was to see the bar fill up with colour when it was slid. Something like this: I hadn’t seen anything like this around...

Categories Experiments/javascript/Prototype Comments: 15
June 5, 2007

Create a registration key

This simple function allows you to generate a random registration key in the format, ‘1224-54B1-7D35-5EF7’. [php]function registration_key() { return strtoupper(substr(chunk_split(sprintf(‘%03d%s’, rand(0,999), uniqid(”)), 4, ‘-‘), 0, -1)); }[/php]

Categories Code snippets/PHP Comments: 0
June 5, 2007

Validate a UK postcode

You’ve probably seen this before, if not a thousand times, but here’s a simple function to check the format of a UK postcode. [code lang=”php”]function valid_uk_postcode($postcode) { return (preg_match(‘/^([A-PR-UWYZ][A-HK-Y0-9][AEHMNPRTVXY0-9]?[ABEHMNPRVWXY0-9]? {0,2}[0-9][ABD-HJLN-UW-Z]{2}|GIR 0AA)$/i’, $postcode)) ? true : false; }[/code]

Categories Code snippets/PHP Comments: 0
April 26, 2007

Briard puppies

I’ve just launched a new web site for my mother-in-law to advertise and show off the new litter from her champion Briard show dog. And let me tell you, the puppies are adorable! http://www.classicshowdogs.com/

Categories Sites Comments: 0
March 20, 2007

Nice image swapping

Here’s a nice, clean, and simply way to swap an image on a click of a link. You might use this if you have one large image a series of thumbnails, and when you click on the thumbnail you want to swap the large image. This javascript will do that and you don’t even need any additional libraries!

Categories javascript Comments: 0
March 20, 2007

HTTP status codes

Quite often I find myself having to send a HTTP status code in the PHP I’m writing. This typically comes down to usually a ‘Forbidden’, ‘No Content’ or a redirect. The trouble is, I usually can’t remember the exact code of text used for the slightly more obscure codes, or at least the ones I don’t use often… Well, even...

Categories PHP Comments: 0
March 20, 2007

String encoding for HTML

I find this a handy function to encompass a number of different string encoding routines. It allows you to do entity encoding (ÿ), hex (á), html (&aecute;), or url encoding (%E1).

Categories PHP Comments: 0
February 27, 2007

CafePress random product update

A small update is required to the CafePress box class – the one that shows a random product from your CafePress store. This is needed because there have been some additional updates to the HTML on the CafePress side, so the regular expression in the class needs updating. It’s very easy; just change line 174 for the following: $this->cpPattern =...

Categories PHP/Updates Comments: 0
February 9, 2007

Same height for elements

Surely this is easy, right? Just set the height property in your css. Well, yes and no. That’s all well and good if you know what height the elements are going to be, but quite often you might be pulling information out of a database in to the elements and you don’t know how big that information is going to...

Categories javascript/Prototype Comment: 1

Posts pagination

  • «
  • 1
  • 2
  • …
  • 9
  • 10
  • 11
  • 12
  • 13
  • »

Me elsewhere

  • Follow me on GitHub
  • Follow me on Twitter
  • My GitHub gists
  • My LinkedIn profile

Tags

amp (2) anvil (3) blacksmithing (8) book (3) build (3) conference (2) error log (2) extension (2) filter (3) forging (7) gist (2) github (7) gpio (3) gui (4) htpc (2) interface (2) javascript (6) jQuery (7) metal (3) objects (2) opcache (3) packt (3) PHP (20) phpnw (2) phpnw10 (2) plug-in (5) plugin (2) Prototype (2) python (3) raspberry pi (7) reactjs (2) review (3) rpi (7) snippet (6) trailcam (2) view helper (3) webinar (2) windows (2) wiringPi (2) Zend Framework (11) zend opcache (2) Zend Studio (2) zend_view (2) zend_view_stream (2) zephir (3)

Categories

  • Blacksmithing (10)
  • Code snippets (20)
  • Databases (2)
  • Experiments (8)
  • Gadgets (5)
  • General (41)
  • GitHub (2)
  • javascript (17)
  • jQuery (7)
  • PHP (47)
  • Prototype (4)
  • Python (2)
  • Raspberry Pi (8)
  • Sites (2)
  • Subversion (1)
  • Updates (2)
  • works07 (6)
  • Zend Framework (17)

Archives

  • November 2023
  • July 2023
  • May 2023
  • November 2022
  • October 2020
  • September 2020
  • July 2020
  • April 2020
  • April 2019
  • March 2019
  • February 2019
  • January 2018
  • November 2017
  • August 2017
  • July 2017
  • May 2017
  • January 2017
  • November 2016
  • July 2016
  • June 2016
  • February 2016
  • September 2015
  • July 2015
  • June 2015
  • April 2015
  • November 2014
  • October 2014
  • June 2014
  • February 2014
  • November 2013
  • April 2013
  • March 2013
  • August 2012
  • April 2012
  • September 2011
  • June 2011
  • May 2011
  • April 2011
  • October 2010
  • September 2010
  • May 2010
  • March 2010
  • February 2010
  • January 2010
  • December 2009
  • September 2009
  • March 2009
  • February 2009
  • January 2009
  • December 2008
  • November 2008
  • September 2008
  • August 2008
  • July 2008
  • June 2008
  • April 2008
  • March 2008
  • January 2008
  • December 2007
  • October 2007
  • September 2007
  • August 2007
  • June 2007
  • April 2007
  • March 2007
  • February 2007

Meta

  • Register
  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Help pay for hosting?

Me elsewhere

  • Follow me on GitHub
  • Follow me on Twitter
  • My GitHub gists
  • My LinkedIn profile

Tags

amp anvil blacksmithing book build conference error log extension filter forging gist github gpio gui htpc interface javascript jQuery metal objects opcache packt PHP phpnw phpnw10 plug-in plugin Prototype python raspberry pi reactjs review rpi snippet trailcam view helper webinar windows wiringPi Zend Framework zend opcache Zend Studio zend_view zend_view_stream zephir

Help pay for hosting?

Categories

Meta

  • Register
  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

© 2007-2025 Andy's blog o' goodness. All thoughts expressed are my own.

Coldbox WordPress theme by mirucon

  • Twitter
  • GitHub
Back To Top