This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private 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); | |
curl_setopt($ch, CURLOPT_USERAGENT,'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13'); | |
$raw=curl_exec($ch); | |
curl_close ($ch); | |
if(file_exists($saveto)){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
require_once BASEPATH . '/libraries/Session.php'; | |
class MY_Session extends CI_Session | |
{ | |
function __construct() | |
{ | |
parent::__construct(); | |
$this->CI->session = $this; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--1. φτιαχνεις εναν holder (gmap-holder) εξω απο το map-canvas που φόρτώνει ο χάρτης. | |
2. Βαζεις καρφωτο pointer-events:none; στο style του map-canvas (ή με αρχείο css). | |
3. Με jquery ελεγχεις το κλικ του holder και αφαιρείς το pointer-events στον χαρτη | |
--> | |
<div class="gmap-holder"> | |
<div id="map-canvas" style="pointer-events:none;height: 650px;width: 100%;"></div> | |
</div> | |
<script> | |
$(document).ready(function(){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<meta http-equiv="cache-control" content="max-age=0" /> | |
<meta http-equiv="cache-control" content="no-cache" /> | |
<meta http-equiv="expires" content="0" /> | |
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" /> | |
<meta http-equiv="pragma" content="no-cache" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Connection { | |
private $uname = ""; | |
private $password = ""; | |
private $host = "localhost"; | |
private $port; | |
private $database = ""; | |
private static $__instance = NULL; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function validateDate($date, $format = 'Y-m-d H:i:s') | |
{ | |
$d = DateTime::createFromFormat($format, $date); | |
return $d && $d->format($format) == $date; | |
} | |
var_dump(validateDate('2012-02-28 12:12:12')); # true | |
var_dump(validateDate('2012-02-30 12:12:12')); # false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET @a = 0; | |
UPDATE favorits SET order = @a:=@a+1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Auto Password Generator | |
function makePasswd() | |
{ | |
var text = ""; | |
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; | |
for( var i=0; i < 8; i++ ) | |
text += possible.charAt(Math.floor(Math.random() * possible.length)); | |
return text; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function inputUppercase(input) | |
{ | |
input.bind('keyup', function (e) { | |
qq = input.val().toUpperCase(); | |
//fix greek accented characters | |
data = qq.replace(/[ΈΆΌΎΊΉ]/g, function (m) { | |
return { | |
'Έ': 'Ε', |
OlderNewer