I found at my parent’s house an old (1930 ?) Campanelclax bicycle bell made of brass. It’s really beautiful and it makes a very loud and annoying sound, like a giant frog.
I decided to restore it and started cleaning the top cover with hot vinegar and salt, a trick found searching on Google.
Unfortunately the bottom of the bell have been painted so now I’ll need to remove the painting and then remove brass oxide.
Check out the photos after the break.
Read the rest of this entry »
Tags: bell, bicycle, brass, campanelclax, restore, vintage -
Now it’s more clean and stylish than before:

Tags: design -
Using the new Firefox awesome bar could result in a frustrating experience, because the SQLite database that holds all the data used by Firefox can get heavily defragmented.
You can get an huge speed improvement running this command inside the Firefox error console:
Components.classes["@mozilla.org/browser/nav-history-service;1"]
.getService(Components.interfaces.nsPIPlacesDatabase).DBConnection.executeSimpleSQL("VACUUM");
Put the command above in the code field (in a single line) and press the evaluate button.
Tags: awesome bar, Firefox, speed, SQLite -
In my previous post I talked about a Lorelle blog post on creating single post templates for different categories.
After using the code snippets “has is” I tryed to build a more flexible solution so I’ve come up with this little function:
function getSingleTemplate(){
$category = get_the_category();
$templateName = TEMPLATEPATH . '/single_' . $category[0]->category_nicename .'.php';
if (!file_exists($templateName)){
$templateName = TEMPLATEPATH . '/single_default.php';
}
return $templateName;
}
This function must be called inside the single.php template: it gets the first post’s category, searches for a template named like “single_post_first_category_slug.php” and returns its path; if the file doesn’t exists it will return the single_default.php template path.
My single.php template:
<?php
$post = $wp_query->post;
include( getSingleTemplate() );
?>
Tags: category, template, WordPress -
Today, while trying to customize the single.php template for a specific category I found a pretty old article written by Lorelle:
Creating Multiple Single Posts for Different Categories.
Her tip is really simple and really useful: just rename your single.php to single1.php and create a new single2.php with your category specific layout; after that, create a new single.php file with this code:
<?php
$post = $wp_query->post;
if ( in_category('1') ) {
include(TEMPLATEPATH . '/single2.php');
} else {
include(TEMPLATEPATH . '/single1.php');
}
?>
So, if the post is in category 1 WordPress will use the single2.php otherwise it will use single1.php.
Updated
I wrote a more flexible solution: check it out.
Tags: category, template, WordPress -
WordPress has a simple function to build a search form for your blog and in this tutorial I’ll show you how to add a category filter to it.
< ?php get_search_form(); ?>
This function will look for a file called searchform.php inside your template folder: if it doesn’t exist it will output the standard search form. So, if it isn’t already in place, create your custom searchform.php and copy into it the default search form output. It should look similar to this:
<form role="search" method="get" id="searchform" action="<?php bloginfo('siteurl'); ?>">
<div>
<label class="screen-reader-text" for="s">Search for:</label>
<input type="text" value="" name="s" id="s" />
<input type="submit" id="searchsubmit" value="Search" />
</div>
</form>
Read the rest of this entry »
Tags: category, filter, functions, PHP, search, template, WordPress -
A well written article on JavaWorld that explains how to effectively use the Runtime.exec() method. It really saved me a lot of time.
When Runtime.exec() won’t – JavaWorld
Tags: Java, link -
Do you love the wonderful javascript dollar shortcut $('myId') but cannot use jQuery or Prototype? Don’t worry, you can define your custom shortcut for the too long document.getElementById() function:
function $(id) {
return document.getElementById(id);
}
Now you can sobstitute this:
var divContent = document.getElementById('myId').innerHTML;
with this:
var divContent = $('myId').innerHTML;
Obviously you don’t get all the bells and whistles that you would get using jQuery, but it’s a start.
Tags: function, Javascript, jQuery, shortcut -