Pro-Tip: Tell your website to treat CSS files as if they’re PHP files to make life easier.
There are only two simple things you need to do to enable this!
I set my clocks early ’cause I know I’m always late.
Posts tagged as:
Pro-Tip: Tell your website to treat CSS files as if they’re PHP files to make life easier.
There are only two simple things you need to do to enable this!
{ 0 comments }
I’m suffering from a little bout of writer’s block these days. When you combine that with the fact that I haven’t been cruising the ‘net finding new and funny things, it makes for a dearth of new content on this site. I was thinking that it would be cool to display a single post from the archives at the top of the home page when there’s nothing new to see. Something like, “Hey! Sorry I haven’t posted anything new in x days, but check out this from y years ago …” I got as far as writing the SQL for it, but then I stopped working on it. I think it’s a good idea, though. Maybe someone will decide to write a plugin to do this. (Or, more likely, someone already has and I am just too lazy to find it.)
{ 0 comments }
I was very happy to see that the WordPress developers included the ability to “tag” posts. For a long time I’ve been using my own bastardized version of Bunny’s Technorati Tags to add tags to this site. A few days ago I decided to bite the bullet and convert to using the tag system that is now baked into this CMS.
Here’s my only problem: The standard WordPress tagging engine is designed so that clicking a tag on a post displays an archives page with all of the other posts tagged with that tag. (Confused yet?) I don’t like that. One reason I don’t like that is because I have not yet managed to transfer all of my tags from the old system to the new, so lots and lots of my posts have no tags. That means if you click a tag for “ovulating kleptomaniac”, for example, you’re not going to get any results. So I have hornswaggled the code a bit to make it so that on this site the tags link to search results for that tag instead. I think it’s a much more “visitor friendly” implementation of tagging.
[click to continue...]
{ 0 comments }
A year or two ago I was returning to my office from lunch with some co-workers. I spotted an old, rusty, razor blade on the sidewalk. “You don’t see that every day,” I said. In retrospect I was probably wrong. Everyone likely sees dozens of rusty razor blades on sidewalks and in gutters every day. We just don’t notice them. That’s not the point. The point is that I told my friend, Jon, that it would make a good domain name. “You should register rustyrazorblade.com,” I said. And he did. Now, if you’re looking for an esoteric, complicated, intense Apache and / or MySQL resource, it’s the place to go. True story.
{ 0 comments }
Found: One brilliant article about being a programmer
Source: MeFi
{ 0 comments }
I was glad to see ColdFusion make it on this list of the top 10 dead (or dying) computer skills. It’s a ridiculous “language” that I never bothered to learn and used to tell people was craptastic and worthless when it was brand new and everybody and their mother was looking for people that knew it. I clearly remember being told that I just had to learn ColdFusion or I was going to miss the next web wave. I scoffed, learned ASP and PHP, and think I made the right call.
I was surprised to see C on the list, though. I guess I can understand that there aren’t many people actually programming in the original C, but I’d say that the basic principles of the language — including C++ and all of its children — are still pretty important.
{ 16 comments }
A few weeks ago a friend of mine asked me to build a WordPress plugin to display a Gunning-Fog analysis on his blog. The math part was pretty easy stuff. I was having a borch of a time getting the plugin to count syllables, so I hunted through Google and found someone else had written a pretty good function to do that. I squished it all together and it seems to be working pretty good.
You can download the plugin here and see it in action here.
{ 3 comments }
Today I decided that my life would not be complete if I didn’t learn how to use Yahoo! Pipes. So I gave it a shot. I couldn’t really think of anything I wanted in a pipe, so I decided to try building one that would let me search eBay for items on my Amazon wishlist. Shouldn’t be too hard, right?
I learned that it is possible to pull your Amazon Wishlist items as an RSS feed, which is cool. I found an example on the Amazon Web Services Developer Connection. You need to have an Amazon Web Services Access Key (AWSAccessKeyId), but they’ll give those away to anyone nowadays. You don’t need to read the full article; I’ll summarize.
{ 1 comment }
If you’re interested in displaying an RSS feed from an external source using PHP, you simply must grab RSS_Fetch by Drew Phillips. It is by far the easiest implementation that I have found. The readme file is very detailed and the code is well-documented. I highly recommend it.
{ 0 comments }
I have been planning to add an “About” page to this site for about four years. Everybody who’s anybody has an “About” page. People who visit and know not what a blog is must wonder what this site is “About”. I just never seem to get around to it. I have no idea what this site is “About”. And every time I take a crack at it I can never seem to be as pithy as all the other great “About” pages I’ve seen on blogs over the years.
{ 1 comment }
This domain of mine has had stuff on it for a long, long time — before WordPress or MovableType or even Blogger. The original davidgagne.net is, sadly, lost forever. Some pieces of it have been kicking around on my various hard drives and FTP locations for a decade now.
One file that I could never seem to bring myself to delete was an ancient hand-coded HTML <TABLE> listing of a bunch of important events in my life. A few friends of mine actually built a company based on the idea. It was called “ShareTimelines.com”, had a magnificent interface, was all webbed up, and the site — last I checked — is completely dead. I wanted to have that timeline on this site again. I hadn’t updated it in years and years, and I would rather poke hot needles in my eyes than sit and hand-code a bunch of <td>s all day. “It should all be in a database, of course,” I said to myself. “And I should be able to edit it right in the WordPress Administrator, too. And seriously it should be written so that I can just give other people the ability to add timelines like that to their own sites.” ( I should stop talking to myself.)
{ 46 comments }
Tags! They’re everywhere! It seems like every site on the ‘net is adding tagging now. Tag clouds — ridiculous, pointless, and annoying — are not the reason. Tagging is a good way to get into Technorati and a good way to get more traffic to your site. It’s a nifty way to organize your posts and to help your readers find what they want on your site. Is it the wave of the future? I don’t know. I don’t think so. Several of the early adopters are now saying that they are useless, and the search engines seemed to be doing a fair job of indexing blogs long before people got tag-happy. But it’s not exactly terribly painful to add this functionality to your site — it only took me about a half hour, so how hard could it be? Plus you’ve got me to explain it all to you.
This how-to assumes that you’re using WordPress to manage your blog. If you are using something else — blogger, MovableType, etc. — then you’ll have to look somewhere else. Technorati is a good place to start.
{ 1 comment }
Although I can appreciate that it’s a really nifty feature, I am likely never going to use the built-in File Upload feature in WordPress. What has bugged me is that it’s in an IFRAME in the Write Post panel; I think it slows the page load. I was trying to get rid of it, but the best I could find was the Clutter Free plugin from Tempus Fugit. It’s a great plugin, but unfortunately it doesn’t really remove the IFRAME, it just hides it.
So. I dug around in the code and did it myself. If you aren’t the file-uploadin’ type, you only need to change a few lines to prevent the File Upload widget from appearing on your Write Post panel. Open wp-admin/edit-form-advanced.php and look for the line containing $uploading_iframe_ID. It’s near or around line 223. There are a few different ways you can handle removing this.
{ 1 comment }
How to Hack MySQL Paging Functionality into Microsoft SQL Server
Web developers using PHP and MySQL have a crucial piece of functionality that classic ASP developers working with Microsoft SQL Server don’t. It’s pagination. Using MySQL’s LIMIT and OFFSET commands you can very easily add pagination to recordsets that you want to display on web pages. If you’ve spent any amount of time searching for a way to do this with ASP and SQL Server, you know that the code is pretty hard to find. You’re lucky if you find it at all. The few tutorials on the ‘net tend to be overly complicated and pretty bad hacks, usually involving convoluted and resource-intensive subqueries on top of subqueries. This solution is certainly not the best, and it, too, is a resource hog, but it’s the only one I’ve got, so I’m sharing.
[click to continue...]
{ 4 comments }
I have finally updated two of my WordPress hack tutorials so that they are compliant with v. 2.04.
The first one — DropCaps — allows you to put that nifty “dropcap” into a post. This post begins with a dropcap I.
The second one — Amazon Tags — adds two new buttons to your editing screen. They allow you to link directly to an Amazon item by its ASIN or to add a link to an Amazon search.
The second one includes a link to a zipped copy. You can just extract quicktags.js into your wp-includes/js folder and the images into your wp-images folder and you’re set.
Happy WordPress modding!
{ 0 comments }