Rafał Wrzeszcz - Wrzasq.pl

Using Disqus in XHTML applications

Wednesday, 28 November 2012, 09:22

Disqus is a great service! Without any doubt - brilliant comments system for any website you have. With it you no longer need to care about implementing comments system, moderation tools, social stream etc. Everything you need from commenting system is there. However there is one problem with it - it doesn't work with real XHTML applications (not so common over the net, but still). What's even worse Disqus team stated clearly that they will not care about XHTML applications. If they won't, then I will :).

Tags: XHTML, Web, Disqus, Code, JavaScript

» Komentarze

ChillDevViewHelpersBundle - PHP templating helpers for Symfony 2

Thursday, 15 November 2012, 10:33

To keep my projects up-to-date some time ago I've chosen Symfony 2 as a base framework to replace outdated Zend Framework (version 1 is old and far behind moder web and version 2 development is far behind Symfony's and the new ZF2 is bloated and messed up). Symfony 2 is a great framework, but there is one thing that I can't understand - why the hell use Twig!? For years people were migrating from engines like Smarty to plain PHP views/templates yelling that templating engines for PHP are stupid idea; and I fully support this thesis. PHP is a great templating engine by default, this is what PHP was created for at it's basic purpose: it's not like Python or Java where you need to send output explicitely - this is the sole feature in case of PHP. Why bloat it with additional templating layer? I personally consider Twig as a step backward and stay with plain-PHP templates. Unfortunately people followed Twig-based conventions and if you want to use PHP renderer you need to do many things on your own - most of popular bundles comes only with extensions for Twig, but not with helpers for PHP rendering engine. This is where ChillDevViewHelpersBundle comes in! It is set of basic helpers for PHP-based templates (hope to extend it in future of course).

Tags: Symfony, XHTML, Tutorial, ChillDev, Bundle, PHP

» Komentarze

Luźne i długie notatki o załatwianiu pożyczek i/lub kredytów hipitecznych

Tuesday, 31 July 2012, 11:22

Tym razem nie będzie technicznie. Nie będzie w sumie w ogóle zawodowo. Po prostu nie mogę sobie odpuścić spisania tych przygód. Tak się stało, że przez ostatnie pół roku miałem całe mnóstwo zawirowań związanych z nieruchomościami, kredytami, a najczęściej jednym i drugim na raz. Nie chodzi mi broń boże o jakieś wylewanie gorzkich żali - jak się chce coś w życiu mieć, to nieraz trzeba pozasuwać. Ale niektóre aspekty, z którymi musiałem się stykać są tak absurdalne, że nawet jeśli to nie dotrze do kogokolwiek, kto w którejkolwiek instytucji mógłby cokolwiek zmienić, to może chociaż ktoś się w niemocy uśmiechnie, albo odetchnie z ulgą, jakie to ma jednak lekkie życie. Zetknąłem się z różnymi instytucjami - od banków, przez doradców i pośredników kredytowych, po urzędy samorządów lokalnych, do tego PKP i kilka innych instytucji. Smutne jest jedynie to, że na co dzień mam styczność z tego typu absurdami na każdym kroku (jak zapewne większość z Was) w większości instytucji i po prostu tym razem natężenie absurdów przerosło poziom, który można by określić mianem barejowskiego.

Tags: Banki, Teksty, Finanse, Hipoteka

» Komentarze

Pork - fork() for PHP

Tuesday, 10 January 2012, 10:24

You always hear how many things modern computers can do at once, how multi-tasking they are… but when it comes to your simple mailing script it hangs on sending few mails and it can't go further. How it is that you run your application on powerful server machine, but your script flow is completely single-tasking? Well, machines and operating systems supports multi-tasking, but you have to write your code in specific way in order to benefit from it - you have to split your program into multiple single tasks that can be executed parallelly. If you are a PHP developer and you need something for multi-tasking, here I give you Pork - fork() for PHP.

Tags: Pork, Skrypty, Code, Kod, PHP

» Komentarze

JavaScript Zend-like url helper

Monday, 25 July 2011, 20:35

In JavaScript, especially when you work with AJAX (many requests to frontend host) and dynamic UI (many requests for assets like images) you have to resolve a lot of URLs. Problem comes, when you have to keep some base of your URLs reference (like web application base URL), or keep your links switchable easily (static hosts balancing). If you are familiar with Zend_Framework, you must know baseUrl() helper for Zend_View. Isn't that a handful thing? Then why not use it in your client scripts as well :)? Here I propose my solution for easy URLs resolving that behaves much like Zend_View's baseUrl() helper.

Tags: Zend, Code, JavaScript, Kod

» Komentarze

Serving static content (CSS and JavaScript) with GZip

Saturday, 23 July 2011, 18:29

When you publish your project in production environment you usualy have some build tasks to be done for each release. For web projects it's good to take care about static contents there - mainly images, CSS and JavaScript. If your project is going to work under heavy load, one of the optimization field will be response size and time. While you will mainly look into your engine/application to shortnen it's response handling time, sometimes it may not be the case. The other point at which you should look is serving static content. Even when those files are stored on separated static server usualy one page load requires loading planty of additional static files. One of the good options is to compress them - smaller size means both smaller bandwidth and shorter loading time for clients.

Tags: Apache2, GZip, CSS, JavaScript, Server, Optimization, Production, .htaccess

» Komentarze