Skip to content

Instantly share code, notes, and snippets.

@e-vural
e-vural / 0_reuse_code.js
Last active August 29, 2015 14:24
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
$(document).ready(function() {
$("form[name=myForm]").parsley();
$("form[name=myForm]").on('submit', function(e) {
var f = $(this);
f.parsley().validate();
if (f.parsley().isValid()) {
alert('This form is valid');
$.ajax({
namespace Acme\ProjectBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\HasLifecycleCallbacks
* @ORM\Table(name="projects")
*/
@e-vural
e-vural / Select 2 Şehir İlce Seçimi Jquery
Created July 13, 2015 16:10
Select 2 Şehir İlce Seçimi Jquery
/*
il gönderdik
*/
$("#il").select2({
maximumSelectionLength: 1,
allowClear: true,
theme: "bootstrap",
ajax:{
url: Routing.generate('sehir'),
<input size="{{ musteri.adsoyad|length+2 }}" value="{{ musteri.adsoyad|upper }}" onkeyup="f(this)">
function f(bu){
if(bu.size) {bu.size=bu.value.length+2};
}
<input type="text" style="text-transform:uppercase;" on keyup="javascript:this.value=this.value.toUpperCase();">
if($this->get('security.authorization_checker')->isGranted('ROLE_YONETICI')){
}
app/config/parameters.yml
mailer_transport: gmail
mailer_encryption: ssl
mailer_auth_mode: login
mailer_host: smtp.gmail.com
mailer_user: adresiniz@gmail.com
mailer_password: şifreniz
app/config/config_dev.yml
@e-vural
e-vural / Symfony Giriş Yapan İp Adresini Alma
Last active October 1, 2015 14:38
from mehmet emre vural
$this->container->get('request_stack')->getCurrentRequest()->getClientIp();
$soft_delete_konular=$em->createQueryBuilder()
->select('s')
->from('CoreCommonBundle:Konu','s')
->where('s.isSoftDeleted =:delete')
->andWhere('s.gonderici =:gonderici OR 's.alici =:alici')
göndericisi x kişisi olan veya alıcısı x kişisi olan demek için OR araya konur
->setParameter('delete',1)
->setParameter('gonderici',$kimlik)
->setParameter('alici',$kimlik)
->getQuery()