Cup 'o seafood chowdah from Gilbert's Chowder House at my desk. #lovemylife 3 days ago

Brent Danley
Science, technology, humor and wisdom.

TAG | programming

The Mind of a Web Developer: An Illustrated Diagram
Matt, Mingle2, June 13, 2007

The Mind of a Web Developer

The Mind of a Web Developer

· ·

Twitter Bird

Tweeting is nice because it’s terse; I can update my tweeps about what I’m doing, resources I’ve discovered and articles I’ve read between more lengthy and media-rich blog posts (and to publicize those posts).

The Twitter Tools plugin is a great way to integrate tweets into a WordPress blog. The most obvious benefit of this is that it keeps the content on the blog page fresh and allows bloggers to communicate bitlets of information that do not require their own post.

In addition to other worthwhile features, Twitter Tools allows a blog admin to display recent tweets in a sidebar widget, and to automatically publish tweets in a daily or weekly digest format. Twitter Tools caches tweets in a table of the WordPress database to reduce the number of calls to Twitter.

There were a few things about the plugin I didn’t particularly like out of the box. First, there was a link below the last tweet in the sidebar widget to take a visitor to my Twitter page. I prefer to have the widget title be that link. Second, the digest post title date format was ugly: “2009-06-29″ instead of “June 29, 2009″. Third, the link at the end of each tweet in the digest post had a simple ‘#’ instead of the date and time of the tweet, which also serves as a link to the original tweet.

(more…)

· · · · · ·

This is my favorite comic. Happy April Fools’ Day!

Foxtrot

Foxtrot

· · · · ·

Replace Microsoft Notepad With Latest Notepad++ v5.0 in Windows

With this fix my favorite little text editor, Notepad++, is now my default Windows text editor.

I love this quote on the The Ultimate Web Developer’s Christmas Wish List post on the Smashing Magazine blog.

Please notice: if a web-developer uses Notepad++, a robust freeware editor for Windows users, he or she will be very unlikely to switch to one of the above mentioned applications.

LOL.

· · · · ·

WAMP

Everybody knows what a lamp is, but how many have ever heard of a wamp?

For years I used one distribution of Linux or another as my primary operating system and mostly loved it. But Gimp isn’t Photoshop and I was tired of using my laptop to manage and edit my photo library. Photoshop CS3 and Lightroom are the programs I use most after Firefox. So I’m back to Windows XP on the desktop. *sigh*

I’ve been developing in Notepad++ lately and love it! The syntax highlighting and FTP functionality make it a wonderful environment. All I have to do is connect to the server, double-click the file to edit, make the modifications and save. The file is automatically uploaded back to the server and immediately available. It is wonderful.

(more…)

· · · · · · · · ·

Brent Danley Photography has been ajaxified!

**The new url is photography.brentdanley.com.**

The “pages” in the gallery have previously been generated by a single PHP file. This was done by passing to itself a page parameter using the get method. This worked well except that the entire page, including images and linked scripts, had to be reloaded every time the user clicked to go to a “new” page. It was certainly better than creating a separate document for each set of thumbnails, though, even if the header and footer were reused. It made little difference to the user who doesn’t know, and probably doesn’t care, how the page is created. An asynchronous transfer would be an improvement the user would notice.

What I did today was eliminate the necessity of the page reload.

Now, using Prototype‘s Ajax.Updater method, a PHP script is passed a page value corresponding the the link on which the user clicked. The PHP script retrieves the thumbnail and image information from the Flickr API using phpFlickr and returns an XHTML string to the calling method on the client. The return string from the PHP script is automatically inserted into the client element specified in the Updater’s url parameter.

function updateGallery(page){	
	new Ajax.Updater('gallery', 'ajax_gallery.php', 
		{method: 'get', 
		parameters: 'page=' + page});
}

I also performed some CSS jujitsu to animate the thumbnails when the user passes the mouse pointer over them. It was as simple as increasing the size of the images and reducing (to -1px) the size of the margins.

#gallery  a:hover .thumb{
	background-color:#888;
	width:85px;
	height:85px;
	border:6px double #003e7c;
	margin:-1px;
	padding:0;
}

Go have a look.

It still takes some time to load each new set of thumbnails. Besides caching, I’m not sure what could be done to remedy that. I’d also like for the navigation links to be better looking buttons or tabs or an accordion. And the return from the Updater call should probably return an XML document. Another day, perhaps.

Let me know what you think.

· · · · · · ·

WordPress 2.5 won .net magazine‘s Open source application of the year for 2009 (issue 184). WordPress is an awesome blogging platform and CMS. It deserves all the accolades it receives.

Version 2.7 is better yet (I upgraded three blogs in the past day). Thanks a bunch, Matt. And congratulations.

· · · · · ·

Notepad++

Notepad++ is a brilliant little text editor. It’s lightweight (2.89M), tabbed, open source, free, extensible and has FTP functionality built in. It also sports syntax highlighting, drag and drop capability and a powerful regular expression search and replace function.

I’ve used Notepad++ for a long time but only recently discovered the FTP capability. Now, instead of using PuTTY to edit directly on the server or uploading with Filezilla (another program I can’t live without), I can edit, save, and upload without leaving my local editor.

What are you waiting for? Head over to the download page and never use Windows’ notepad again!

· · · ·

It’s up.

Today I put up a temporary page at BrentDanleyPhotography.com. I registered the domain some time ago and used it as a sandbox for learning Lightbox. I’ve been feeling a ton of pressure to keep up with web development technologies. I need to be able to perform well should I be offered my dream job. I’ve been reading up on XHTML, CSS, PHP, JavaScript, MySQL and, especially, how they all come together to create asynchronous dynamic pages.

Lightbox, it turns out, is as simple as adding a single rel attribute to an anchor tag. First you must embed the Prototype JavaScript Framework and the Script.aculo.us and Lightbox libraries.

<script type="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript" src="js/scriptaculous.js?load=effects,builder"></script>
<script type="text/javascript" src="js/lightbox.js"></script>

Then you simply add the rel attribute with value lightbox to any anchor tag that points to a picture. Voila!

Click <a href="http://url/to/image.jpg" rel="lightbox">here</a>.

The pictures for BDP are served by Flickr and retrieved via the API with the help of phpFlickr. I used Flickr’s machine tag feature to allow me to more precisely search the photos for inclusion in each category of BDP.

Cheers. Let me know what you think.

· · · · · · · · · ·