Saturday, November 28, 2009
Baked lasagna and potatoes & kebab style seitan
Baked lasagna and potatoes with summer vegetables and some cheese
before |
after |
Kebab style chopped and fried seitan with fresh vegetables and bread
Delicious!
before |
after |
UPDATE: i386 package is updated, because it was not correctly packaged.
Element.implement({ removeAllOptions: function() { if(this.get('tag')!='select') return this; for(var i=this.options.length-1;i>=0;i--) this.remove(i); return this; }, addOption: function(text,value) { if(this.get('tag')!='select') return this; var optn = new Element('option'); if(text) optn.text = text; if(value) optn.value = value; this.options.add(optn); return this; }, removeOption: function(prop,value){ if(this.get('tag')!='select') return this; for(var i=this.options.length-1;i>=0;i--) { if (prop=='selected' && this.options[i].selected) this.remove(i); if (prop=='value' && this.options[i].value==value) this.remove(i); if (prop=='text' && this.options[i].text==value) this.remove(i); if (prop=='index' && i==value) this.remove(i); } return this; } });Methods hopefully already explaining their self.
// remove all options or empty select box $('selectbox').removaAllOptions(); // add options, one after another $('selectbox').addOption('One',1).addOption('Two',2).addOption('Two',3); // removing options $('selectbox').removeOption('text','One'); $('selectbox').removeOption('value',2); $('selectbox').removeOption('selected'); $('selectbox').removeOption('index',0);happy selecting ;)
header('Content-Type: text/css');I came across this when i was writing this script:
## combine.php // Define path prefix $prefix = realpath('.'); if(!empty($_GET['js'])) { header('Content-Type: application/x-javascript'); $data = Array('path'=>$prefix.'/template/js/','files'=>$_GET['js'],'ext'=>'.js'); } elseif(!empty($_GET['css'])) { header('Content-Type: text/css'); $data = Array('path'=>$prefix.'/template/styles/','files'=>$_GET['css'],'ext'=>'.css'); } else exit(); foreach(explode(',',$data['files']) as $file) { if($file && file_exists($data['path'].$file.$data['ext'])) readfile($data['path'].$file.$data['ext']); }Simple few lines of code, but already do the trick. That will minimise number of server requests and benefit in faster page loading.
<link rel="stylesheet" type="text/css" href="combine.php?css=style,forms" /> <script type="text/javascript" src="combine.php?js=mootools,validate,fx"></script>Hope you like it, otherwise If you want more advanced solution try minify.