When you start with symfony you probably use the Symfony Standard Edition.
This is a quite good start but there are somethings that helped me and might help you aswell.
Since every beginning is “schwer” :)
So here there are.
Continue reading “Symfony2 Starter Tweaks”
Silverstripe Profilable module
This is a reoccuring requirement: you need a profile for some object in your project.
FE you have a company, a member or a location that should get an address, a marker on the map, an icon, homepage etc.
So I created a small silverstripe module that adds a profile tab to any object you choose in your Silverstripe CMS backend.
javascript benchmarking with jsperf
I might be a bit late (yeaikno it exist over a year now and a bunch of blogs had it covered) but nevertheless i would like to point out a very helpful online tool i recently ran into:
Its basically a online benchmark tool for testing different approaches in javascript.
It covers some important aspects of benchmarking, that your homemade bench probably wont have like milliseconds accuracy & statistical analysis.
The tests are run on your browser and the results will feed the “browserscope”. A graph of the “highest known results” for the participating browsers.
So we can see some kind of comparison.
Continue reading “javascript benchmarking with jsperf”
modulo in Twig
Ever wondered how to use the modulo operator in twig, the template engine of symfony?
Actually its like in PHP:
{{ 11 % 7 }}
As described here
But i guess for most use cases modulus is used to check if a number is divisible by another number.
Therefore Twig has the very conveniant divisible by test function.
{% if loop.index is divisible by(3) %}
Silverstripe Setup Script
We thought we had to improve our SilverStripe setup script for our development environment.
So Max and me rewrote it to add submodules and some other improvements.
Just run:
./install_silverstripe.sh mynewproject tags/2.4.7
and you have
- silverstripe project folder structure
- the tutorial theme
- a already filled git repository
- sapphire as submodule
- cms as submodule
- Uploadify as submodule
- DataObjectManager as submodule
- UserForms as submodule
Silex and MongoDB simply
Using MongoDB in your Silex Project is quite easy.
I will show this with my Superleansilexplate and will integrate it there as an example.
Since i dont want to integrate MongoDB in Superleansilexplate it will just become an additional gist.
Given you have some smaller amount of data like a counter that needs to be stored or other loose coupled datasets, we simply speak to MongoDB “directly” and store the data via Doctrine MongoDB Abstraction Layer.
Since i presume the Data / Document Structure isnt that complex we dont use Doctrine MongoDB ODM (the Object Document Mapper).
If you want to use it instead, try this Silex Extensions.
extend SilverStripe memberprofile module
Alright, SilverStripe again, still our CMS of choice.
Today i’d like to promote a very helpful module that provides Register and Profile Pages for Members for the Frontend.
The memberprofiles module.
It comes with a lot of features and customize options for nearly everthing you might need for Frontend Member Handling.
Further it is fully extendible to customize it even more.
For a starter tutorial i recommend a very good post by deadlytechnology.
I would like to describe how you extend it.
First lets install it (with the orderable module dependency):
thank gawd it’s online #3
A little making of history from duckduckgo search engine.
http://www.gabrielweinberg.com/blog/2011/12/duckduckgo-used-to-run-out-of-my-basement.html
LinkedIn node.js performance tricks
http://engineering.linkedin.com/nodejs/blazing-fast-nodejs-10-performance-tips-linkedin-mobile
introducing PHP’s composer
http://nelm.io/blog/2011/12/composer-part-1-what-why/
promoting PHP’s composer
http://nelm.io/blog/2011/12/composer-part-2-impact/
node.js and PHP
http://bergie.iki.fi/blog/dnode-make_php_and_node-js_talk_to_each_other/
JavaScript API for zooming
http://lab.hakim.se/zoom-js/
Gadget: little printer
http://vimeo.com/32796535
jQuery Animations with automatic CSS3 transitions when possible
http://playground.benbarnett.net/jquery-animate-enhanced/
Batman.js is a framework for building rich web applications with CoffeeScript or JavaScript.
http://batmanjs.org/
some HTTP-Status Cats
http://www.flickr.com/photos/girliemac/6508022985/in/set-72157628409467125
Expeditions in the Cloud
Caution: Scepticism ahead!
So i’d like to share some of my experiences in the cloud since i am still trying to figure out if it its worth for me or if i am better suited with an VPS.
Maybe somebody feels like feedbackin.
I tried PHPFog for PHP and no.de by joyent for node.js.
First i have to admit: yes i only tried the free models and of course they are limited and because its free you cant expect to get it all, right?
Yes and thats true.
With PHPFog i set up an app based on symfony 1.4. After some inital problems due to some bugs on PHPFog side, i got it running.
I really like to mention the kind and immediate chat support by PHPFog. It really made me feel like dealin with humans and not only machines. Big up!
By then everything felt really smooth with git deploy, configurations, mysql setup etc.
But i had to shut down the app again, because there are restrictions to PHP which killed the app like disabling “file_get_contents for remote URLS”, probably only in the free model. But that killed it for me at that point.
So read this carefully before going to cloud: http://docs.phpfog.com/index.php/features/article/shared_vs_dedicated
I guess with dedicated hosting you get more power, sure.
Silex and the HTTP_CACHE
The HTTP_CACHE resp. the reverse proxy of Symfony is a pretty cool thing.
And as it is build-in Silex it can speed up the already fast micro framework massivly,
wich is good for me, as i am mainly workin with Silex right now.
To enable it you have to register it first like its shown in the docs:
$app->register(new Silex\Provider\HttpCacheServiceProvider(), array( 'http_cache.cache_dir' => __DIR__.'/cache/', ));
Also provide the writable cache dir.
Continue reading “Silex and the HTTP_CACHE”