- First rotisserie on the BBQ
- RT @SheldonNesdale: Can you help me give my free ebook away? "How to Optimise Your NZ Website For Search Engines": http://bit.ly/84fQAh #
- RT @textmator: Amy Editor http://www.amyeditor.com/ #
- RT @keesfransen: RT @TylorSkory: Go to http://google.com and click "I'm Feeling Lucky" without typing anything to see a surprise. #
- Just created some lighting lines for fun http://yfrog.com/3nasiuj
from http://bit.ly/3m4cM0 #
- The DL link is broken
RT @smashingmag: Jellyfish-CSS 1.2: a free powerful CSS editor for Mac – http://bit.ly/70qlIK #
- hey @telecomnz, I'm not happy with my BB speeds of late ! Whats going on ? any issues in Tauranga CBD ? #
- http://bit.ly/622U2o
RT @SheldonNesdale: @totalinz re: TaurangaWebsites.co.nz That would be "Van" at NetMatters http://bit.ly/8zf5h6 #
- Just watched 'kingdom of hevean' I mysky'd it a week or so ago, not bad. #
- I have been working on the 2010 release of @dreamcatchernz this morning, http://bit.ly/4CHDGe #
- Sorry for the Tweet SPAM, this was due to our system, and Twitters delayed sending issues. http://bit.ly/8Du9OI #
- RT @5hameless: RT @iamkhayyam: I'm a PC. I'm a MAC. | http://bit.ly/4SZnyO *haha! #parody! #
- RT @keesfransen: 5 Reasons Pigs Are More Awesome Than You http://theoatmeal.com/comics/pigs from @oatmeal #
- I am proud to say – TGIF & TGFB !
(Thank god its friday – Thanks god for beer ) #
- Saturday morning humor http://media.funlol.com/content/img/did-it-hurt-when-you-fell.jpg #
Category Archives: Life
Twitter Weekly Updates for 2010-01-03
- I just learned that the 1st known recording of Led Zeppelin happened @ Gonzaga University in Spokane on 12/30/1968. (@biggreenape @Klymacks) #
- Some one didn't make it to midnight http://yfrog.com/4fxjjpj #
- Hey @TelecomNZ my interwebs are SLOW today !
http://www.speedtest.net/result/668331951.png in reply to TelecomNZ #
- Just got back from spotty fishing, got a good couple bits of cat food down that the Tauranga jetty's. #
- @SheldonNesdale Thanks, will check it out tomorrow. That site really needs a lot of work, mostly it is there for the customer account area. in reply to SheldonNesdale #
- @telecomnz WTF is wrong with my net last couple of days ?! SO SLOW ! #
- @SheldonNesdale I have a feed that should be picking up everyone with in 35k of Tauranga CBD
http://twitter.sheldon.lendrum.co.nz/ in reply to SheldonNesdale #
- running updates for the mother-in-law's windows ME machine, brought it home as I couldn't beer to use her Dial Up #
- defragging windows ME, and almost done. #
- Whats new ?
Twitter Weekly Updates for 2009-12-27
- Help Please, #CodeIgniter and #fpdf pdf generation http://codeigniter.com/forums/viewthread/45365/P15/#685785 #
- RT @mike9r: HP is going to learn how social media can kill you: their webcams are racist http://idek.net/p0i (via @iA) #
- I just successfully restored a files from 2 weeks ago #thanks #apple #timemachine ! #
- RESOLVED: RT: @sheldonlendrum: Help Please, #CodeIgniter and #fpdf pdf generation http://codeigniter.com/forums/viewthread/139181/ #
- pretty – firefox 4 windows screenshots
http://blog.stephenhorlander.com/2009/12/21/windows-themeui-update/ # - RT @vodafoneNZ: RT @SitaMitaBita and others: RT @flyairnz: from our friends @grabaseat wildlife – The Cougar – http://bit.ly/6bqBFQ #
- Sweet mac Growl theme #mono http://fixedgear.ca/ #
- I just saw the #trademe guy in http://www.trademe.co.nz/Community/OfficeCam.aspx picking his nose !!! #
- Thanks @google – Merry Christmas ! http://www.google.com/advertising/holiday2009/
- When advertising goes bad http://i.imgur.com/uoJi0.png (via @timothymarshall) #
- RT @mike9r: Microsoft loses patent appeal, is ordered to stop selling Word and Office starting January 11th. Wow! http://idek.net/phI #
- At the mall, kmart is sold out of sellotape !! #fml #
- I'm watching Forrest Gump – classic! #
- Even Santa bends the rules sometimes… http://pics.livejournal.com/photognome/pic/005fk3zq.jpg (via @photognome) #
- Did you get some last night or something ?
Hm. I'm in a good mood today.
(via @dustindikes) # - RT @vodafoneNZ: RT @nigelramsay: RT @daaanpace: adidas star wars collection http://bit.ly/8DByU4 sweet! #gottagetmeoneofthose #
- 1 working hour of 2009 to go – ish… #
- @mwproductions I have heard 3d isthe ONLY way to see Avatar ! in reply to mwproductions #
Twitter Weekly Updates for 2009-12-20
- I took it and so should you—The Survey For People Who Make Websites, 2009: http://aneventapart.com/survey2009 #
- Sequel Pro, can you import a 120mg mySQL database ? #
- Yes, yes you can ! I remember when you would crash with a 2mg import
Happy times ! # - RT @iPhonewzealand: For those of you with a US iTunes account, check out the free 20-track iTunes Holiday Sampler . http://bit.ly/5ZC9Uo #
- @rowanbeentje Thanks, yeah, worked well, Great App BTW ! in reply to rowanbeentje #
- @rowanbeentje I have SP 0.9.6, checked for updates, there is no 0.9.7 ? in reply to rowanbeentje #
- RT @totalinz: RT @iPhonewzealand Latest…Kiwi App Review: NZRSS http://bit.ly/79J67o / #2 thanks to you
http://yfrog.com/4eaqtj # - My Niece made me and the misses a christmas video.
http://elfyourself.jibjab.com/view/B5aXdb2F7p4RHCr9xSoY # - This morning's work at @totalinz – Merry Christmas from the Vodafone Warriors
- Check out my latest game of Clown Town! http://yfrog.com/3lpyytzj (http://rampchamp.com/) #
- Check out my latest game of Icon Garden! http://yfrog.com/33vhyqj (http://rampchamp.com/) #
- Check out my Blue Kazoo in @RampChamp! http://yfrog.com/3g25oj (http://rampchamp.com/) #
- Got an iPhone ? Get this !! http://bit.ly/7E2GsZ #
- Hey I Google number 1 for 'sheldon'
http://yfrog.com/aukp6p
( Maybe a little bias ) # - Best church Christmas billboard evar: http://bit.ly/915lEG (via @gnat) #
- I'm at the @glassartnz workshop http://yfrog.com/4e7amgj #
- Try @totalinz
RT @gnat: dear lazyweb: who in NZ has business experience around open content (text, audio, video, interactive)? # - home time, home time, home time. #
- Hey @telecomnz, Does your pro account has 80gig data allowance now ? http://yfrog.com/1ybccyj #
- I just upgraded in to wordpress 2.9 on my blog http://sheldon.lendrum.co.nz #
- Sweet Deal.
@sheldonlendrum for a limited time it does, details here http://bit.ly/8jDU3i ^DM (via @TelecomNZ) #
- CAn anyones help as to why my #php #fpdf PDF generation is not creating new files, but juts adding new pages ? #
- Who drinked my cougar ? http://yfrog.com/3laviuj #
Yahoo – sheldon.lendrum and torrents
How do I rank number 1 for ‘torrent.com’ ?
I found this out on here!! http://sheldon.lendrum.co.nz/search-rank-for-sheldonlendrumconz/ – God I have to post more !
Now using FeedBurner RSS
In preparation to a major overhaul of this site, I have moved my RSS feeds to Google’s FeedBurner.
Please alter your RSS subscription links to ;
http://feeds.feedburner.com/sheldonlendrum
Use PHP and the GD Library to make CSS Sprites
I came across some neat free Icons a couple of day’s ago. I found 178 free icons by WooThemes.
They suited my needs for some navigation icons I was after, so after a quick download, I have them all. Great.
Now, when I code, I’m all about speed of page loads with our reducing quality of course. So more and more and with that I have been using CSS sprites for images, the Less requests, the faster a page loads. there are hundreds of articles explaining this sort of thing, like only use 1 CSS file, putting your Javascript at the bottom, I use them, I even have written a Mootools extensions for embedding Google Analytic in to my sites, that secretly embed the GA code after the page has loaded so its doesn’t slow down the rest of your site from loading, tracking external links and form submits, but any how that is for another post.
178 PNG icons
After extracting the ZIP, I found 178 separate icon files, and I wanted a gray-scale version of each for a hover state, that would mean up to 356 requests plus all of the rest of the images on that page.
Now of course I’m not going to use every Icon, but you never know !
Using PHP & the GD Library to make my Sprite
I must Credit Sandy for his awesomeness and contribution to this script.
< ?php
function spriter($dir = '*.png', $dest = 'sprite.png', $spacing = 0) {
// define icons sizes
$icon_width = 32;
$icon_height = 32;
// start height of my sprite canvas
$height = 0;
// select all the icons and read theri height to build our canvas size.
foreach (glob($dir) as $file) {
list($w, $h) = getimagesize($file);
// make sure out icon is a 32px sq icon
if ($h == $icon_height)
$height += ($h + $spacing);
}
// double our canvas height to allow for a gray-scale versions.
$height = ($height * 2);
// create our canvas
$img = imagecreatetruecolor($icon_width, $height);
$background = imagecolorallocatealpha($img, 255, 255, 255, 127);
imagefill($img, 0, 0, $background);
imagealphablending($img, false);
imagesavealpha($img, true);
// start placing our icons from the top down.
$pos = 0;
foreach (glob($dir) as $file) {
$tmp = imagecreatefrompng($file);
if (imagesy($tmp) == $icon_height) {
imagecopy($img, $tmp, 0, $pos, 0, 0, $icon_width, $icon_height);
$pos += ($icon_height + $spacing);
}
imagedestroy($tmp);
}
// place all of our icons on again, but this time convert them to gray-scale
foreach (glob($dir) as $file) {
$tmp = imagecreatefrompng($file);
if (imagesy($tmp) == $icon_height) {
imagefilter($tmp, IMG_FILTER_GRAYSCALE);
imagecopy($img, $tmp, 0, $pos, 0, 0, $icon_width, $icon_height);
$pos += ($icon_height + $spacing);
}
imagedestroy($tmp);
}
// create our final output image.
imagepng($img, $dest);
}
Sample Usage
< ?php
// IMPORTANT: REMEMBER TO MAKE SURE THE WEBSERVER HAS WRITE ACCESS TO YOUR DESTINATION DIRECTORY.
spriter('icons/*.png', 'icons/sprite.png', 10);
Show our Sprite
?/>)
CodeIgniter & SPAW Editor Tabs
A few months ago, I updated a great SPAW editor plug-in for CodeIgniter to use the most recent version of SPAW at the time, that included Safari Browser fixes and some CSS tweeks.
Well over the weekend I look at getting multiple tabs working.
It was pretty easy, with a couple of modifications to the SPAW wrapper class, I have create some sample usage, and examples for you to download.
I have made the CSS fixes from my previous post, and included some sample usage.
I am only going to explain how to create the SPAW instance within CodeIgniter, If you are unfamiliar with CI, you should first follow the Online Code Igniter Tutorial Videos.
Creating the SPAW instance
In my download, you will find a ‘pages’ controller.
function index() {
// Define our first tab
// 'name' == field name,
// 'caption' == button caption,
// 'content' == editor content
$config = array(
'name' => 'content',
'caption' => 'Content',
'content' => !empty($_POST['content'])?$_POST['content']:'CodeIgniter & SPAW Tabs
SPAW Editor Class for CodeIgniter, Sheldon Lendrum
'
);
// start our SPAW instance
$this->load->library('spaw', $config);
// Add our secondary tabs
$this->spaw->addTab('description', 'Description', !empty($_POST['description'])?$_POST['description']:'');
$this->spaw->addTab('summary', 'Summary', !empty($_POST['summary'])?$_POST['summary']:'');
// load our view
$this->load->view('template');
}
SPAW Class
I have modified the SPAW class with 3 functions.
function Spaw($config) {}
The Spaw function initiates the Spaw editor. you pass in an array of the default Tab.
function show() {}
This returns the SPAW instance in to your view. It will return a string, so you will need to echo this in your layout.
EG;
< ?php echo($this->spaw->show()); ?>
You must call this ONLY IF SPAW is called in your controller previous.
function addTab($name, $caption, $value) {}
This is to add additional tabs to your spaw instance.
Your default tab is defined when you create your SPAW instance, so this is how you can call additional tabs.
$name == your field/$_POST name
$caption == your button title
$value == the SPAW editor default value.
Installing SPAW & CodeIgniter
I have included a full copy of CodeIgniter 1.7.1 with SPAW 2.0.8.1,
If you want to move the SPAW plugin to your own copy of CI, move the;
'system/application/libraries/spaw2' directory and the
'system/application/libraries/spaw.php' file.
If you are on an APACHE server and using MOD REWRITE url rules, make sure you have the included .htaccess file in the spaw2/ dir.
'system/application/libraries/spaw2/.htaccess'
Download and Install
[download#9]

