This file contains 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 | |
/* Translate Savaş Can ALTUN < savascanaltun@gmail.com > */ | |
return [ | |
/* | |
|-------------------------------------------------------------------------- | |
| Validation Language Lines | |
|-------------------------------------------------------------------------- | |
| | |
| The following language lines contain the default error messages used by |
This file contains 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
1c349abe3d2ee7889fc44dff28dfbb2bff25376910f75615cff9d180f2014f6cf46fa21a79a2 |
This file contains 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
// Turkish | |
function cutNumber(value) { | |
var newValue = value; | |
if (value >= 1000) { | |
var suffixes = ["", "Bin", "Milyon", "Milyar"," Trilyon"]; | |
var suffixNum = Math.floor( (""+value).length/3 ); | |
var shortValue = ''; | |
for (var precision = 2; precision >= 1; precision--) { | |
shortValue = parseFloat( (suffixNum != 0 ? (value / Math.pow(1000,suffixNum) ) : value).toPrecision(precision)); | |
var dotLessShortValue = (shortValue + '').replace(/[^a-zA-Z 0-9]+/g,''); |
This file contains 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 | |
/** | |
* İnsan sınıfı x) | |
* @author Savaş Can ALTUN <savascanaltun@gmail.com> | |
* @link http://savascanaltun.com.tr | |
* @version 1.0 | |
*/ | |
class Human { |
This file contains 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 | |
/** | |
* @author Savaş Can ALTUn <savascanaltun@gmail.com> | |
* www.savascanaltun.com.tr | |
*/ | |
$tarihBas = strtotime('1.1.2016'); // date Start | |
$tarihSon = strtotime('24.06.2016'); // date End | |
$rastgeleTarih = rand($tarihBas, $tarihSon); // create random | |
echo(date('d.m.Y H:i', $rastgeleTarih)); // convert time |
This file contains 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 LoginController extends BaseController { | |
// | |
public function getLogin($id){ | |
$user=Auth::loginUsingId($id); | |
if (!$user){ | |
throw new Exception('Giriş Hatası'); | |
}else{ |
This file contains 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 | |
/** | |
* @author Savaş Can ALTUN <savascanaltun@gmail.com> | |
* @link http://savascanaltun.com.tr | |
* PHP strpos function in array | |
*/ | |
function strposa($text, $finds, $offset=0) { | |
if(!is_array($finds)) $finds = array($finds); | |
foreach($finds as $query) { | |
if(strpos($text, $query, $offset) !== false) return true; |
This file contains 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 | |
$source = file_get_contents("https://graph.facebook.com/?id=http://www.savascanaltun.com.tr"); | |
$json = json_decode($source, true); | |
echo "Total : ".$json['shares']; // return number format | |
?> |
This file contains 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 | |
/** | |
* Create random time [ PHP ] | |
* @author Savaş Can ALTUN <savascanaltun@gmail.com> | |
*/ | |
function randomTime($first,$last){ | |
$number = rand($first,$last); | |
if($number<10){ | |
$result='0'.$number; | |
return $result; |
This file contains 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
RewriteEngine On | |
RewriteBase / | |
RewriteCond %{HTTP_HOST} !^siteadi.com$ [NC] | |
RewriteRule ^(.*)$ http://siteadi.com/$1 [L,R=301] |