‘tips’ ile ilgili yazılar

Symfony 2: Setting Cookies

Symfony 2 is great but it’s not well documented yet and there is no documentation about cookie handling as well. After a few code digging I’ve found the solution. As we know, basically, cookies are just HTTP headers and you can get them from requests or send with responses. Symfony\Component\HttpFoundation\Response class has a public property named [...]

Symfony 2: Getting Current Route in Twig

Twig: {{ app.request.attributes.get(‘_route’) }} Php: $app->getRequest()->attributes->get(‘_route’) Controller: $this->container->get(‘request’)->attributes->get(‘_route’)

Javascript: Remove Element From Array

var myArray = ['foo', 'bar']; var elementIndex = myArray.indexOf(‘bar’); // Finding index of the element we want to remove if (elementIndex != -1) { myArray.splice(elementIndex, 1); } console.log(myArray);

Smarty Modifiers

Günlüğe yazmayalı oldukça uzun zaman olmuş…Gerek işlerin yoğunluğu, gerekse mevsimin yaz olması nedeniyle günlüğe yazı yazmak pek aklıma gelmedi açıkçası. Bugün bir web uygulamasında smarty ile ilgili birşeyle uğraşırken smarty’nin yeri geldiğinde ne kadar faydalı bir yapı olabileceğini bir kere daha anladım. Neyse fazla uzatmayacağım. Smarty Modifiers sayesinde Php dahili (?) fonksiyonlarını doğrudan Smarty Modifiers [...]

Xmms / Audacious için Winamp ekolayzır ayarları

Şuradaki adresten winamp ekolayzır ayar dosyası indirilir. Daha sonra arşiv yöneticisi*[1] ile açılır. Arşivin içinden çıkan eq.preset dosyası xmms ya da audacious programlarından hangisini kullanıyorsanız onun ayar klasörünün*[2] içine kopyalanır. Program yeniden başlatılır ve winamp ekolayzır ayarları arık kullanılabilir durumdadır. *[1] Komut satırından: gunzip -c winamp_presets.gz > eq.preset*[2] Xmms için home dizini altında .xmms , [...]

ImportError: libgtkembedmoz.so: cannot open shared object file: No such file or directory

I think Python is looking this package under the /usr/lib/mozilla directory. If you have no mozilla browser installed on your system (my system is FC6) and your application (for ex. listen, exaile) needs libgtkembedmoz.so library you probably will get this error. For the fix this problem: First create named as /etc/ld.so.conf.d/mozilla.conf And put the firefox [...]

IP idreslerini mysql tablolarında saklamak

Mysql’de ip adreslerini saklamak icin varolan bir veri tipi yok malesef.Web uygulamalarımda kullanmak için watchdog tarzında bir ortam geliştirmeye başladım bugün.Ip adreslerini mantıklı bir şekilde saklamak ve daha sonra kolayca ulaşabilmek için kullanılan yöntemleri merak ettim.Google’da birkaç aramadan sonra buldugum birkaç ipucunu buraya yazayım istedim. mysql’de unsigned int(11) tipinde bir alan acip php’nin ip2long fonksiyonu [...]

If you are using $_SESSION (or $HTTP_SESSION_VARS), do not use session_register(), session_is_registered(), and session_unregister().

Installing Java on Fedora Core 6

Download Sun’s Java Software Development Kit Version 5.0 Update 9 Open new terminal Run These commands $ su – $ cd downloaded_java_sdk_dir/ $ chmod +x jdk-1_5_0_09-linux-i586-rpm.bin $ ./jdk-1_5_0_09-linux-i586-rpm.bin Install java-1.5.0-sun-compat package via yum $ yum –enablerepo=jpackage-generic-nonfree install java-1.5.0-sun-compat For activate Java plugin in your Firefox $ ln -s /usr/java/jdk1.5.0_09/jre/plugin/i386/ns7/libjavaplugin_oji.so /your_mozilla_plugin_dir[1*] [1*] For example : /usr/lib/mozilla/plugins/ [...]

This does not look like a tar archive

The problem is… $ tar -zxvf file.tar.gz/bin/gtar: This does not look like a tar archive/bin/gtar: Skipping to next header/bin/gtar: Archive contains obsolescent base-64 headers/bin/gtar: Error exit delayed from previous errors …and the solution $ gzip -d file.tar.gz$ tar -xf file.tar