July 2nd, 2009

It is true that since XP in windows there is a tool called Disk Cleanup. Personally I think Disk Cleanup is stupid. It takes too long to show me what I can delete and what not, and too many seconds of my life to then actually do it. So it’s been a long time that I came with a different solution, at least for the infamous temporary folders (such as c:\windows\temp, and yes there’s more than one) that are usually filled with crap that doesn’t seem to be temporary at all.
I created a batch file that safely does everything with a double click. Here’s the content:
@ECHO OFF
TITLE Temporary Directories Cleaner by ico – code.italyisfalling.com
IF %TMP% == %TEMP% (
IF EXIST %TEMP% ( RMDIR /Q /S %TEMP%
IF NOT EXIST %TEMP% MKDIR %TEMP%
SET message1="%TEMP%" directory emptied.)
)ELSE (
IF EXIST %TEMP% ( RMDIR /Q /S %TEMP%
IF NOT EXIST %TEMP% MKDIR %TEMP%
SET message1="%TEMP%" directory emptied.)
IF EXIST %TMP% ( RMDIR /Q /S %TMP%
IF NOT EXIST %TMP% MKDIR %TMP%
SET message2="%TMP%" directory emptied.)
)
IF EXIST %SystemRoot%\TEMP ( RMDIR /Q /S %SystemRoot%\TEMP
IF NOT EXIST %SystemRoot%\TEMP MKDIR %SystemRoot%\TEMP
SET message3="%SystemRoot%\TEMP" directory emptied.)
CLS
ECHO.
ECHO %message1%
IF EXIST /I %message2% ECHO %message2%
ECHO %message3%
ECHO.
ECHO All done.
pause
EXIT /B
Seems complicated but it is simple. It uses variables so it doesn’t matter where your temporary folders are. The script deletes and recreates your temp folders, although this happens only in the intentions because files that are being used in the folders prevent the deletion. Anyway it works and it is fast… It will wipe your temporary folders clean. Don’t be worried for files that Windows might be using, those won’t be touched simply because they’re opened by the system.
So, if you want to use it yourself, provided that I am not responsible for what you make of it, you know the drill. Copy the code above in a text file and save it as something.cmd on your desktop or wherever you want. Make a shortcut and make sure the file will always be “Run as administrator”.
If you prefer, you can download this file directly. Let me know if you liked this thing.
p.s. If you happen to host the Firefox cache in one of your temporary folders, you should know that Firefox won’t be very happy to have its cache wiped out by an external application such as this. After having run the batch file, also empty the Firefox cache from the browser, even though it will be empty already. Otherwise the websites you have on your tabs will start looking very funny.
This was filed with the windows slops / made with batch file, disk cleanup, temporary folder, windows
/ No Comments »
June 30th, 2009
You might have noticed that I am moving all wordpress-plugins-related materials out of my journal. They did not belong there, and it was absurd to have them aside.
Lines of code is now a separated entity that will deal with my wordpress plugins plus other IT related experiences I’d like to share. The moving process isn’t entirely over, the whole make-up is not on yet, so please bear with the oddities for a while.
I also have updated Stray random quotes, to version 1.9.8. I am not making this revision public on the wordpress repository since it is a small fix, of a bug that affected only those who used ajax on widgets or shortcodes or template tags limited to a contributor.
From the changelog:
Fixed: a small bug caused contributors not to be considered when using AJAX.
here’s the link to download Stray Random Quotes 1.9.8.
let me know in the comments what you make of this transfer ~ if you care.
This was filed with the Wordpress Plugins / made with plugins, stray-random-quotes, updates, wordpress
/ 1 Comment »
June 25th, 2009
this revision brings a couple of changes and a little fix. Nothing major but still needed. From the changelog:
Added: when contributors are allowed to add and manage quotes, it is now possible to specify whether a widget, a shortcode or a tag should display quotes only from a given contributor. See the help page for more.
Changed: Widget layout.
Fixed: the link buttons for the author and source fields on the edit page would not work.
As always, you can download it here or from the Wordpress Repository.
This was filed with the Wordpress Plugins
/ No Comments »
June 16th, 2009
This revision addresses a couple of compatibility issues raised by conflicts with other plugins and the slightly different way the new Wordpress 2.8 has to load javascript.
From the changelog:
Changed: For compatibility with other plugins that use similar or too common names for their shortcodes (above all NextGen gallery), the shortcodes of Stray Random Quotes have changed names. Please take note before worrying about malfunctions: random-quote is now stray-random, all-quotes is now stray-all and quote is now stray-id. Please make the appropriate changes everywhere in your blog where Stray Random Quotes shortcodes are used, or they won’t work anymore.
Sorry about this, I hoped and tried to implement a more clever automatic check on the active shortcodes but unfortunatley many plugins don’t register theirs correctly and it is not possible from inside a wordpress plugin to identify them with certainty.
Fixed: some of the settings got reset upon activation because of a comparison based on version number that for unknown reasons did not work. Possibly a PHP bug. I disabled the comparison and the problem should not present itself anymore, although it might cause issues to users who upgrade from very old versions of the plugin.
Fixed: a compatibility issue with Wordpress 2.8 in conjunction with other plugins that loaded jquery (as experienced by many with Ozh Admin Drop Menu+Stray Random Quotes). I welcome anyone’s feedback on this since I haven’t tested the fix in all possible scenarios and other problems might be lurking around.
( Let me just add that I find quite absurd the position of some plugin authors who always maintain that conflicts between plugins don’t concern them. For them, it is always up to the other author to solve the problem: the other author is the guilty one. Whether this can be true or not (and many times it isn’t), they don’t seem to care if they leave the user out in the lurch, which on the contrary is the only thing that matters. This is not how we do here, anyway. )
Version 1.9.6 can be downloaded here, or on the Wordpress Plugin Repository.
This was filed with the Wordpress Plugins
/ No Comments »
April 14th, 2009
I feel good about this revision.
I felt good about this revision until I found a tiny bug that caused a javascript error in IE. The bug was small but it caused me to issue version 1.9.5 right away, lest too many of you guys were to download version 1.9.4. in the meantime. Actually by the time 1.9.5 was out already at least 350 users had downloaded 1.9.4 from the Wordpress Repository. Sorry about it.
The good points of 1.9.4 are still valid though. For starters, I caught a pretty nasty bug that caused AJAX not to work in Firefox when Stray Random Quotes was the only plugin loading jQuery on Wordpress (if that makes any sense to you).
I still don’t know the reason for the bug but I fixed which is enough. So if you experienced problems with AJAX in the past please try this version, there’s a chance the problems are over.
I squashed other little bugs as well, did some code rewriting, verified all the localization lines (some of the maintainers still have to update their localizations though).
As for the new things, the plugin has now Danish localization, thanks to Georg. Also it is now possible to disable the aspect settings (from the “how the quotes look” section of the settings page) from each widget, shortcode or template tag: I think this is a welcome feature for those who use the plugin in more than one area of their blog. For example you might have a series of quotes in the sidebar via a widget, and another series showing up as random taglines in your header. In such a case it might be a good idea to disable the aspect settings in the second series, where the only thing left would be a space between quote and author or source.

in picture: the new “disable aspect” setting in the widget
More importantly, the plugin is now accessible to contributors of your blog. In other word, those users who are not administrators but are enabled to create and edit posts can now be allowed to create and edit quotes. You can enable this feature in the settings page of the plugin.
Please note: To implement this functionality the quotes table in the database has to be manipulated (a ‘user’ field is added to it). It is a one-time safe operation that happens automatically upon activation, but you might want to consider backing up the database before you upgrade just to be on the safe side.

in picture: how quotes from a contributor appear in admin management page.
The new version can be downloaded from this page.
It is all for now, hope you enjoy it.
This was filed with the Wordpress Plugins
/ No Comments »
April 2nd, 2009
A new version of Stray Random Quotes is out. It fixes few important bugs and rewrites some parts of the admin pages to make them more readable and usable.
More importantly, after reading the Top 10 Characteristics of a Great WordPress Plugin by Thaya Kareeson, I added a simple way to reset the options to factory defaults. His top 10 is almost entirely fulfilled by Stray Random Quotes now.
Here’s the changelog:
Added: ability to reset the settings to factory defaults (in the Tools page). Changed: parts of the settings page. Also changed and expanded: the help page (much more readable now) (You must know at this point that there is NOT another wordpress plugin with such a exhaustive embedded help page). Fixed: the [quote] shortcode and the stray_a_quote template tag wouldn’t work with PHP 4. Thanks to Kathryn and Nathan for poiting out this bug and testing the fix. Fixed: Nasty bug that caused the settings in the tools page (such as the bookmarklet options or the shortcode extensions) to be reset whenever the user updated the options in the settings page.
You can grab version 1.9.2 here.
This was filed with the Wordpress Plugins
/ No Comments »
March 25th, 2009
I feel for those of you out there who don’t love frequent updates, I know it is a pain but this upgrade is necessary because a nasty malfunction of the quote shortcode AJAX functionality.
Here’s the changelog:
Fixed: noticeable bug within the quote shortcode that prevented AJAX and the sequence of quotes to work. Thanks to marc for pointing this bug out. Fixed/changed: parts of the help page.
I also take this occasion to remind the maintainers of locale files that the locale versions need updating, whenever they feel like it. Thanks to you all.
Stray Random Quotes 1.9.0
This was filed with the Wordpress Plugins
/ No Comments »
March 19th, 2009
this new revision fixes minor bugs with version 1.8.8 (the AJAX loader loaded two quotes at a time, and using “all” in template tags and shortcodes did not retrieve quotes from all the categories.) Everything seems pretty stable now, so this version is also made public on the wordpress repository. Here is a pretty stupid combined changelog for 1.8.8 and 1.8.9:
1.8.9 Few bugs fixed of version 1.8.8, which included the following: Added: the quotes can now rotate automatically after a given interval of seconds. Added: widgets and template tags can load more than one quote a time; Added: the loading message can now be customized in the settings page; Added: Croatian translation thanks to Rajic; Changed: the help page has been rewritten in large part. Changed: removed the title options in the settings page, that were useless. Fixed: the loading message does not cause the collapsing of the quote area anymore. Fixed: many minor bugs. This version rewrites most of the code of the core functions, merging a great deal of lines and hopefully making the plugin more efficient.
Donations are also possible now.
Grab Stray Random Quotes here.
This was filed with the Wordpress Plugins
/ No Comments »
March 16th, 2009

– In picture: the new widget options
The new version 1.8.8 of Stray Random Quotes is out, for the moment only available on this blog.
Big changes and improvements this time. From the changelog:
Added: the quotes can now rotate automatically after a given interval of seconds. Added: widgets and template tags can load more than one quote at a time; Added: the loading message can now be customized in the settings page; Added: Croatian translation thanks to Rajic; Changed: the help page has been rewritten in large part. Changed: removed the title options in the settings page, that were useless. Fixed: the loading message does not cause the collapsing of the quote area anymore. Fixed: many minor bugs. This version rewrites most of the code of the core functions, merging a great deal of lines and hopefully making the plugin more efficient.
Grab the new Stray Random Quotes here.
This was filed with the Wordpress Plugins
/ No Comments »
February 25th, 2009
This is a major update. From the changelog:
Added: bulk editing to the management page; added: a dedicated Tools Page where fantastic things can be achieved (such as a bookmarklet and the ability to extend shortcodes to new areas of the blog, which in turn will allow you to have random quotes and words in unexpected locations); added: per-widget and per-tag ability to disable ajax; changed: the way the [random-quote] shortcode works (now accepts much more variables); fixed: pagination of the [all-quotes] shortcode (thanks to frettsy). There are other enhancements and quite enough minor bugs fixed. So much of the innovation with this version is thanks to the suggestions and requests of the users, to them goes my most sincere gratitude.
You can grab it here.
Two important notes: First, please be advised, as the changelog recites, that the random-quote shortcode has changed, and if you used it with variables in the past there’s a chance it won’t work when you upgrade. Consult the Help page from the plugin menu for more.
Second, I know there is a poll open and some of you voted for a new feature (images with the quotes), that is still not implemented. But the thing is, bulk actions where ready and it seemed a pity not to make the plugin public at this stage. Besides, the poll turned out to be not very much voted, and not unequivocal. Also, images with the quotes is a pretty hard feature to implement the way I want it be, so it will take more time.
This was filed with the Wordpress Plugins
/ No Comments »