mbe.ro
<h2>What is this web-site?</h2> <br/> <start_coding(); //just some tips and tricks for web programmers<br/>echo "Hope this is helpful to you";<br/>?>

jQuery Slide Bug / Fix

November 3, 2009 at 3:12 PM

In IE the jquery slide effect does not work so well. So I tried to make a fix (but using the jquery ui effects). I rewrote the slideUp, slideDown and slideToggle (and all of them work like a charm in all browsers):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
$.fn.slideToggle = function (_speed,_function) {
	$(this).toggle('slide',{direction:'up'},_speed,_function);
}
$.fn.slideUp = function (_speed,_function) {
	if (!$(this).is(':hidden')) {
		$(this).hide('slide',{direction:'up'},_speed,_function);
	} else {
		if (_function)
			_function.call();
	}
}
$.fn.slideDown = function (_speed,_function) {
	if ($(this).is(':hidden')) {
		$(this).show('slide',{direction:'up'},_speed,_function);
	} else {
		if (_function)
			_function.call();
	}
}

Another way to add custom fonts to HTML

October 17, 2009 at 11:10 AM

While surfing I stumbled upon this . It’s a new way, no javascript, just CSS. (this is actually better because, this way custom fonts could be covered even for people that don’t have javascript enabled).

Check it out. I think it’s very good. I haven’t tried it myself yet but from what I read it’s actually cross-browser (even on mobile phones) and it’s fast. Another advantage to using this method (I think, haven’t tested actual facts) is you can use custom fonts on really long texts without your browser running slow, or loading time to be slow.

Thanks snook.ca for that. :)

HTML 2 Array – faster and better – v1.02

September 15, 2009 at 12:52 PM

I’ve improved the class a lot and I’m still working on making it better. Now, it recovers the single tags (like img and meta and so on) and the rest the same time the other recovered without the single tags.
You have the option of ignoring the single tags. It’s actually much better (the algorithm is improved).
Anyway.. You can download it and view more on the google code page: http://code.google.com/p/php-html2array/

Fast and easy PHP MySQL Class

August 30, 2009 at 3:09 AM

I will share my best PHP class to help you connect to MySQL. It is easy to use (easier than the classic way). It is fast and it helps you if you forget to escape some strings before inserting or things like those.

If you use it please reference me, this site and my email address (as a comment in the code is fine :P )
Read more…

CakePHP 1.2.4.8284 Session Component Bug

August 20, 2009 at 6:08 PM

I just had a rather idiot error in CakePHP: I have a page with an ajax loaded area. In the webpage the session variables were not recognized but in the ajax loaded area they were (no matter how many refreshes of the page).

I did not find the source of the problem, however I have a fix (I don’t know how to reproduce the bug, I just know it happened and so it could happen again). To whoever might need it: If you have the app_controller created, if not, create it yourself, or whatever, make sure you have the following:

1
2
3
4
5
6
7
<?php
class AppController extends Controller {
	function beforeFilter () {
		parent::beforeFilter();
		if (!isset($_SESSION)) session_start(); //cakephp dumb fix
	}
}

Another stupid IE fact

August 5, 2009 at 4:15 PM

Yet another dumb IE fact: Internet Explorer adds margin to the <form> tag.

So everytime you start a CSS you must enter (besides other):

1
2
3
form {
	margin: 0;
}

One more time… Thank you Microsoft for the great product that is Internet Explorer, NOT.

Alternative to SIFR and FLIR

July 27, 2009 at 12:56 AM

Pretty good one too, very fast and very nice. It’s called Cufon. A friend of mine has discovered it and I’m sharing it. This blog, itself, is an example of the script (as I am using it for the titles).

Use it wisely.

The link to About Cufon: http://wiki.github.com/sorccu/cufon/about
and the link to Cufon Usage: http://wiki.github.com/sorccu/cufon/usage

PayPal Development – DirectPayment function

July 7, 2009 at 6:37 PM

Lately I have been working with Paypal Developing. I stumbled upon the wizard and it gave me step by step instructions but when I tested the script, the script said that the function “DirectPayment” is undefined. They forgot to include the function. So I googled and googled but nothing. So I made the function myself. For all of you that need it, here it is: Read more…

PHP HTML to Array – working one

June 21, 2009 at 12:29 PM

A while ago I needed a good PHP to Array function or class but I could not find one that would actually work well. All raised a warning or an error or just plain and simple did not work. So I made one that transforms an HTML to Array (also works with XML) that works as good as it can. The URL for Google Code Project is http://code.google.com/p/php-html2array/ (you can download it from there as well).
Read more…

Ubuntu Preview PSD Files

May 23, 2009 at 3:13 PM

I started using Ubuntu 9 (Jaunty) about three weeks ago. I am super satisfied. The only problem was I could not get a good program to view PSD files fast (like IrfanView in Windows). I tried xnview but it just wasn’t so good and it was pretty ugly as well.

Now, I found a way to view the psd files in Eye Of Gnome using gdk-pixbuf-psd. Now, above it all I have preview of the psd-s just like I have for images.

It’s great. Enjoy!

Next posts »