Hooked on YUI? You can now take it anywhere you go. The thing is Yahoo hosts the libraries publicly, so they are available at any time. Let’s say you visit a page and you want to do something with it. Comes the YUI bookmaklet that adds a new script tag to the page pointing to […]
Nice title, eh? OK, so all of a sudden theweathernetwork.com buttons I was using to show the weather in Sofia, Bulgaria and selected Canadian cities on the community site bgcanada.com, stopped working. Reason: unknown. So it was time for a change, since those buttons were generated by some javascripts, hosted by theweathernetwork, which is kind […]
I got a copy of a book called strengths finder (or something) that advocates that you should know, love and get your strengths to work, instead of focusing on correcting weaknesses. They have an online test to figure out your strengths, here are mine. Ideation Intellection Adaptability Input Positivity Nice list, eh? Basically I’m full […]
» Download here This is my first PEAR release and I was actually surprised how easy it is to package and roll out a release. So you have your local copy of the CVS repository that contains the scripts you want to release as part of the package. In order to release, you need package.xml, […]
One of the cons of using any of the good and popular third-party JS libraries is the file size of the .js files associated with them. A lot has been done by the library developers to address this issue – providing minified versions, segregating the script files based on what they do and using loading-on-demand, […]
Here are two bookmarklets that could make your life easier when trying to figure out why in IE a page behave as wrong as it behaves. For Firefox we have Firebug, so none of this is necessary. For IE we have also Firebug lite (see my post), but you need some setup before you can […]
Here’s one solution to centering an image both horizontally and vertically, when you know the height of the container. Tested in FF, IE6, IE7 The markup: <div class="container"> <img src="pearbook.png" /> </div> Styles for normal browsers: .container { height: 200px; width: 300px; display: table-cell; text-align: center; vertical-align: middle; border: 1px solid red; } .contain img […]
Here’s a hacky thing, I called it JSON data island, referencing the XML data island, that MS came up with for their IE browser. The idea is to use a comment in your HTML that holds some data in JSON format. Then using DOM, you access the comment, eval()-uate it and there you go – […]
Recently I decided to clean up all the spam from an abandoned phpBB forum of mine, there was a lot to delete. In the phpBB version that I use there is no option to “check all” topics you want to moderate. So I came up with a little bookmarklet to do this for me. Here […]
Boris of http://www.ajaxplanet.ru/ has published a translation of my article on the little AJAX/MVC framework I came up with, this is trully flattering, thanks a lot! If you speak Russian check the post here. The translation is by Gennady Potapov, sposibo Gennady!
So you know how to add external scripts and styles, using the DOM, after the page is loaded. And what if you don’t have external files, but have some style definitions and some JS code as text and you want it inserted and executed into a page. The DOM way “Ha! An easy one”, you’d […]
Let’s say you want to quickly try out some small stylesheet changes, but you don’t want to (or prefer not to, or for some reason temporarily you just can’t) modify your application’s CSS file(s). In FF it’s easy – you have Firebug and you can play with styles until blue in the face. And in […]
If you use PEAR::MDB2, you can set a custom debug handler and collect all the queries you execute for debugging and performance tunning purposes, as shown before. But what if you’re using PEAR::DB? Well, since PEAR::DB doesn’t allow you such a functionality out of the box, you can hack it a bit to get similar […]
Through a trackback I found out that Walter Cruz has translated my DB-2-MDB2 article in a language I was led to believe is Brazilian Portuguese. the announcement the article Thanks very much Walter, this is very flattering! Thanks to my buddy Isidoro who enlightened me that the language was Portugeese!
It’s official, last Friday, Jan 12, I pledged my allegiance to the Queen (and her successors) and sang Oh Canada in French and English. Now I’m Canadian. Incidentally this happened 10 days after Jan 2nd when Bulgaria became part of the European Union. Now I am European Canadian, North American Bulgarian and otherwise a citizen […]
What could possibly be better for a writer’s ego other than being read and being praised? Hmm… So I wanted to have a page that shows the books I’ve written, together with their Amazon sales rank and the average customer rating and number of reviews. It’s really easy. I took one example out of the […]
This is a follow up to a question posted by Sam in my DB-2-MDB2 post. The question was if you can reuse an exisitng database connection you’ve already established and not have MDB2 creating a second connection.
Coming back to those MySQL events with a sort of more practical example. In case you’ve missed the previous post, events in brief: turns out that in MySQL starting from 5.1.6. you can setup and schedule cronjobs in the DB server itself. These are called events. An intro article and MySQL manual entry. What these […]
The journey “Fall in love with MySQL (again)” continues from here (triggers) and here (views). Next stop – MySQL events. A cold shower first – events are not available in versions < 5.1.6. so chances of using them any time soon are pretty slim. You need to upgrade to 5.1. (beta) if you want to […]
Today I saw a post at digg.com on image resizing with PHP and there was quite a discussion. Let me share the laziest way (that I know of) how to do it – PEAR::Image_Transform is all it takes. Here goes: <?php require_once ‘Image/Transform.php’; $i =& Image_Transform::factory(”); $i->load(‘test.jpg’); $i->fit(100,100); $i->save(‘resized.png’, ‘png’); ?> In addition, the Image_Transform […]
Continuing (from here) the “Discover MySQL’s enterprise features” trip, let’s check out the Views. As the name suggests, a view is like a specific predefined way to look at a table or tables. You can create a View out of one table or you can JOIN a few tables. Back to the `blog` database example. […]
In a previous post about the MySQL triggers, I mentioned that inexpensive web hosts are now offering MySQL 5. This was based on ICDsoft’s hosting plan, this is a (highly recommended, awesome support!) company I’ve been using for years and I was thinking that it represents the avegarge $50-60/year web hosting solutions offered worldwide, which […]
This is a follow-up to Lars’ comment about the PEAR book. In the MDB2 chapter I showed an example how you can create custom debug handlers in MDB2 and then gave a suggestion about a useful application of this functionality for performance tuning. Basically the idea is that your custom debug handler collects all queries […]
Now that even my favourite $50/year web hosts (example) are offering MySQL 5 and even recommending it over 4, why not take advantage of MySQL’s “enterprise” features. Like triggers. OK, what’s a trigger? It’s something that happens as a result of something else. Clear? Yeah, maybe an example. Say, as it often happens in life, […]
Update: A better version of what I was trying to do is here. It works around the cross-domain permission problems in IE by not loading a page in the frame, but putting there the actual content. Firebug – no words to describe how cool it is, really. After the recent new release (1.0. beta) the […]