Skip to content

Instantly share code, notes, and snippets.

@rantastic
rantastic / grab_image.php
Created April 11, 2013 15:24
PHP: Save image from URL
function grab_image($url,$saveto){
$ch = curl_init ($url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_BINARYTRANSFER,1);
$raw=curl_exec($ch);
curl_close ($ch);
if(file_exists($saveto)){
unlink($saveto);
}
@rantastic
rantastic / datetime.php
Created April 12, 2013 23:19
PHP: Datetime date format
$date = date('Y-m-d H:i:s');
@rantastic
rantastic / fadeOut_remove.js
Created April 16, 2013 15:05
JS: jquery fadeout and remove
$('element').fadeOut('slow',function(){$('this').remove();});
@rantastic
rantastic / php_error_reporting.php
Created May 9, 2013 14:38
PHP: Error reporting
/////////////ERROR REPORTING
ini_set('display_errors',1);
ini_set('display_startup_errors',1);
error_reporting(-1);
/////////////ERROR REPORTING