Skip to content

Instantly share code, notes, and snippets.

$('table').dataTable({
"aaSorting": [[ 0, "desc" ]] // Sort by first column descending. (ilk kolona göre sıralama yapar)
//0 first colomn 1 second like a array (0 ilk kolon 1 ikinci array gibi )
});
$date = new \DateTime('now'); // today (bugün)
$dogum_gunleri = $em->createQueryBuilder()
->select('p')
->from('CoreCommonBundle:YourEntity','p')
->where('p.school=:school')
->andWhere('p.birthday LIKE :birthday')// LIKE important
->setParameter('okul',$okul)
->setParameter('birthday', '%'.$date->format('m-d').'%')//this is important format must be (m-d) and must be %
$(document).ready(my_function); //you have a function its name my_function. You can call this after page load
Or //bir fonsiyonunuz var diyelim adı my_function olsun. sayfa yüklendikten sonra böyle çağırabilirsiniz
$(document).ready(function () {
// Function code here. //buraya isterseniz kodlarınızı yazıp bir fonksiyon oluşturabilirsiniz
});
/*document+ ifadesi string yapar. Yoksa split fonksiyonu çalışmıyor*/
/* docunment+ makes string. unless document+ split function dont work */
var id = document+$('.chosen-select').val();
var hepsi = id.split('_')
$('.chosen-select').val(); //chosen-select is your class. you must use class
//chosen-select sizin class ınız. class kullanak zorundasınız
var id = "ctl03_Tabs1";
var lastFive = id.substr(id.length - 5); // => "Tabs1"
var lastChar = id.substr(id.length - 1); // => "1"
wget -c http://www.yoursite.com/your_route/ &> /dev/null
//&> /dev/null yazarsanız e-mail ile bildirim atmaz
//&> /dev/null if you write this part it dosent send email notification
we will use SUBSTRING function
$monht = 12; or 11 or 01 your choice
$variable = $em->createQueryBuilder()
->select('sd')
->from('YourEntitypath','sd')
->where('SUBSTRING(sd.fulltime,6,2) =:month') 6,2 important
->andWhere('sd.otherwhere =:other')
->setParameter('month',$monht)
->setParameter('other',$var)
var fotograflar = [];
$("img.bekleyen-foto").each(function() {
fotograflar.push(this.src);
console.log(fotograflar);
});
var num1 = 5;
var num2 = 6;
var sum = num1 + +num2;
or
var sum = eval(num1 + num2);
console.log(sum)