“the only source of knowledge is experience” – Albert Einstein
8 Jun
Every day the same problems with typo3. There are extensions that run with mootools 1.1 and there are many extensions that run with mootools 1.2. Installing two extensions with differents mootools supports is a big pain in the a$$. The big question is where is the root of the problem. Should the mootools guys provide a better compatibility mode for their versions (backwards) or should the author of an extensions take care of updating their extension to run with the newest mootools library ? So, to solve the problem with a quick hack here is what I’ve done:
/* if (t3lib_extMgm::isLoaded( ‘t3mootools’ )) {
require_once(t3lib_extMgm::extPath( ‘t3mootools’ ) . ‘class.tx_t3mootools.php’);
}
if (defined( ‘T3MOOTOOLS’ )) {
tx_t3mootools::addMooJS();
} else {*/
$header .= $this->getPath( $this->conf['pathToMootools'] ) ? ‘<script src="’ . $this->getPath( $this->conf['pathToMootools'] ) . ‘" type="text/javascript"></script>’ : ”;
//}
What does this mean ? After removing the lines that loads the generated mootool library from t3mootools, the origin mootools version from rgsmoothgallery will be loaded. Thats all. Have fun …
23 Mar
I will start to create a list for my favorites Tools:
Filesystem
Editor
Launcher
16 Jan
The maximum title length that Google will display and index in 66 characters including punctuation and spaces.
8 Sep
If you get this error, than you have a problem with your python-multiprocessing package. There are two possibile ways to solve this problem. You can install the backport or you can patch the latest version of python-multiprocessing. Ive done last thing, so here we go:
// first remove the old version from your debian system
# apt-get remove python-multiprocessing
// get the latest version from svn
# svn checkout http://python-multiprocessing.googlecode.com/svn/trunk python-multiprocessing
// get the patch http://code.google.com/p/python-multiprocessing/issues/detail?id=18
# cd python-multiprocessing
# patch -p1 < 0002-Fix-logging-of-processName.patch
// install it
# python setup.py install
Now this should solve your problems. I hope that the guys behind python-multiprocessing will release soon a newer version of their package.
4 Sep
Before I start I must confess, I love the mootools framework. It becomes my choice of js framework. Ok, lets start. For a cute project I will release soon, I convert many ajax post to a json posts and for that reason I needed a function that converts submit params directly to a JSON object. After some minutes Ive enhanced the Element class with a new function called toJSON. What does this do ? After traversing all html elements it creates a new array and return a JSON.encode object ready to be send to an url. Here is the function:
Element.implement({
toJSON: function() {
var json = {};
this.getElements(‘input, select, textarea’, true).each(function(el){
if (!el.name || el.disabled || el.type == ‘submit’ || el.type == ‘reset’ || el.type == ‘file’) return;
var value = (el.tagName.toLowerCase() == ‘select’) ? Element.getSelected(el).map(function(opt){
return opt.value;
}) : ((el.type == ‘radio’ || el.type == ‘checkbox’) && !el.checked) ? null : el.value;
$splat(value).each(function(val){
if (typeof val != ‘undefined’) json[el.name] = encodeURIComponent(val);
});
});
return JSON.encode(json);
}
});
22 Mar
It’s time to switch to GIT. For the last years I’ve worked with CVS and with SVN. Both systems are great and every system has got their disadvantages. But after using GIT I come to the conclusion that this is the best versioning system I have every used
Good work Linus!
A little reference for my daily work:
# git init
# git add readme
# git commit -m "initial import"
# git remote add origin git@github.com:ledil/xxx.git
# git push origin master
# git pull origin master
13 Aug
Last day Ive read an interesting post about 7 lessons Olympians can teach internet entrepreneurs. I believe that these lessons are also valid for other groups or companies. Here there are:
7 Aug
Ive been using the python-twitter for some stuff and Ive noticed that the actual version doesnt support the "source" parameter and also doenst support identi.ca. For this reason Ive spent some minutes to do a hack. This version includes a new function named "SetSource" that allows you to define your source "…from blabla" that will be display on twitter and introduces the new parameter "twitterserver" to __init__. This parameter is optional and the default value is twitter.com. identi.ca is another microblogging service based on laconica that supports the entire twitter API. Great step!!
e.g. for SetSource:
# import twitter
# api = twitter.Api(username=’me’,password=’secret’,twitterserver=’identi.ca/api’) // for identi.ca, default=twitter.com
# api.SetSource(‘dilella’)
# api.PostUpdate(‘it works’)
Download twitter.py!
23 Jul
It’s have been a long time when Ive made my last blog entry
So back from the holiday and full of enthusiasm I modified the great multibox 1.3.1 library to make it run with the MooTools 1.2. The new version can be found here:
Multibox 1.3.1 – MooTools 1.2
Overlay 1.2 – MooTools 1.2
Please dont write me mails for additional information but contact the author of multibox. (phatfusion)
6 Jun
The problem when you use mktime is that it converts your python datetime (with/without dst) to your localtime. But if you want to convert it only to a normal unixdatetime without tz you need to create an own function. Here is an example that Ive used for a project:
def dt2ut(date):
total = ((date.year-1970)*365) + int(float((date.year-1970))/4.0)
monthdays=[31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
for i in range(1,date.month):
total = total + monthdays[i-1]
total = total + date.day
total = total*86400 + 3600*date.hour + 60*date.minute + date.second + 1e-6*date.microsecond
return int(total*100)*10

My blog is worth $1,693.62.
How much is your blog worth?