Centrare nello schermo tutti gli oggetti Window

Ext.override(Ext.Window, {

beforeShow : function(){

delete this.el.lastXY;

delete this.el.lastLT;

if(this.x === undefined || this.y === undefined){

var xy = this.el.getAlignToXY(this.container, ‘c-c’),

pos = this.el.translatePoints(xy[0], xy[1]);

if(this.position === ‘cascade’){

this.x = Ext.winPosx = (Ext.winPosx)? Ext.winPosx+20 : pos.left;

this.y = Ext.winPosy = (Ext.winPosy)? Ext.winPosy+20 : pos.top;

}else{

this.x = this.x === undefined? pos.left : this.x;

this.y = this.y === undefined? pos.top : this.y;

}

}

this.el.setLeftTop(this.x, this.y);

//gestione dell’espansione

if(this.expandOnShow){

this.expand(false);

}

//gestione finestra modale

if(this.modal){

Ext.getBody().addClass(‘x-body-masked’);

this.mask.setSize(Ext.lib.Dom.getViewWidth(true), Ext.lib.Dom.getViewHeight(true));

this.mask.show();

}

}

});

 

 

http://www.marcolecce.com/blog/2011/11/22/sencha-extjs-centrare-nello-schermo-tutti-gli-oggetti-window/

Windows 98 crash

http://www.youtube.com/watch?v=UNqWpz5kh6o

Win98 crash – CNN transcript

“…just plug it in. It’s gonna say, ‘Hey! I see you’ve plugged in a new device’, and it’s gonna load in the appropriate drivers.”
[close up of Windows98 screen]
“You’ll notice that this scanner… whoa!”
[close up of screen now displaying the familar blue screen of death]
[prolonged cheering from audience]
“… Moving right along…”

“This must be why we’re not shipping Windows 98 yet?”

“Absolutely! Absolutely!”


Upload e download di file con curl

upload

<?php
if (isset($_POST['MAX_FILE_SIZE'])){

$file=$_FILES['userfile']['tmp_name'];
$ch = curl_init('http://myurl.com/recieve_posted.php');
curl_setopt($ch, CURLOPT_POSTFIELDS, array('file'=>"@$file",'testkey'=>'testvalue',));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$postResult = curl_exec($ch);
curl_close($ch);
print
"$postResult";
}
?>

 

 

download
<?php
$url = ‘http://www.example.com/a-large-file.zip’;
$path = ‘/path/to/a-large-file.zip’;
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$data = curl_exec($ch);
curl_close($ch);
file_put_contents($path, $data);
?>