Enfin! J’ai refait mon site

Après plusieurs mois a avoir une partie du projet de fait, et laissé là. J’ai mis en ligne.

C’est la saison des refontes de sites personnels à ce qu’il paraît, beaucoup de monde l’ont refait.

Il n’est pas parfait. Il n’est pas final. Mais il est utilisable et en meilleur état que la version précédente.

Pourtant ça faisait un bon moment que j’avait déjà de quoi de fait. Mais je voulait faire plus grand!

Comme je disait, l’intégration était déjà faite avec mon espace de travail sous Yeoman (Grunt), les patterns de RoughDraft.js et Twitter Bootstrap, tout était prêt sous forme statique (voir le styleguide).

Avant de publier, je voulait en plus;

Puis un moment donné je me suis dit:

Je veut juste publier!

Deux soirs de travail plus tard, tout a été intégré dans WordPress!

C’est une leçon de vie: apprendre en utilisant de nouvelles techniques, mais c’est important aussi de livrer.

Même pour des projets personnels.

Fonctionnalités

  • Écriture sous format Markdown
  • Servi via SSL seulement
  • Caching du contenu avec Memcached
  • Billets balisés avec micro-format RDFa

Outils de travail utilisé

  • Thème enfant de Roots, adapté
  • Twitter Bootstrap, avec mon propre thème utilisant LESS

J’ai aussi crée une maquette statique spécifiquement pour le balisage HTML. Tout ceci dans le but de me concentrer sur l’aspect intégration web du projet, à coté de la partie blogue, base de donnée ou serveur.

Pour ceux que ça intéresse, j’ai commencé a utiliser intensivement Yeoman et RoughDraft.js.

Voir le Styleguide statique de mon site web

À venir

Maintenant que le site est en ligne, j’ai déjà prévu d’autres choses pour l’améliorer.

Notamment:

  • Migration du serveur web sous NGINX avec module SPDY (au lieu d’Apache)
  • Caching HTTP seulement (Varnish ou Memcached, a déterminer)
  • Quelques effets Javascript chargés progressivement
  • Relire, et corriger tout le contenu (ce billet n’a pas été révisé, je l’ai écrit rapidement)
  • Ajouter de nouvelles vues

Mercis

Je voulait donner un beau merci à Gabriela Viana qui est la responsable du design de mon site.

Choosing a framework, how I personally define what is “hot” about them, an evaluation process (part 1)

This post is all about what I think should be used to define quality in your choice of programming framework tool-set. This post is the first one of a collection of (unknown for now) number of posts.

This week, I had to bring to a team of people what I consider a good PHP framework and why I am sold. I am aware that I may sound blinded with my choice, but this post is about explaining my own guidelines about my choice. I work with them since many years and that made me try many in the PHP ecosystem.

Everything goes with PHP Sauce

Things can get messy with PHP, that’s why we have to be very cautious on how we structure and consider recommendations from other good programmers.

Since we know that PHP can be a “sauce where everything goes”. Structure is crucial. There is many frameworks, many libraries, and to be able to build solutions that will solve more usefull and important matters, we need to agree on how to collaborate.

I do not claim to be a guru, I have done stuff and thanks to people I mention here, I feel I am getting better at the craft and I thought my reflection process was worth sharing.

 

 

Continue reading “Choosing a framework, how I personally define what is “hot” about them, an evaluation process (part 1)”

How I managed to make work Guzzle REST client library under Symfony 2.0.x as a bundle [Snipet]

Warning This is not a cut and paste solution. But some notes I want to share on how I did and what I’d like to cover and remember when I will continue working with that aspect on my current projects.

The problem i had was mostly that i had to see where to mix-and-match things between this wonderful library and Symfony2. I discovered after searching here that it’s not that complicated, you just need to get through the learning curve of reading the code AND the documentation.

I am posting here the hilight of what I have been struggling with and will re-read soon about how to use it and implement in into Symfony2.

Things I wished I understood faster

  • How to inject the configuration from symfony without hardcoding paths in my Managers/Controllers
  • Why do the XML configuration file has nodes like <client> in the main project file, but it’s not what triggers the Command. Answer: Use ServiceDescription::factory($xmlFileFullPath) from the Client class. Yes, it has <client> nodes… NO, they are not the same as in the client definition file xml (guzzleclients.xml).
  • How to extend a DynamicCommand from the ServiceDescription

The Gist

Improvement paths

Actually, now that I went through all this, A simple yaml annotation with a simple service definition with @MyBlogBundle/Resources/config/serviceDescription.clientName.xml could had done the job.

Trying to find templating engine library of markup generating schema.org/RDFa content

I am currently working on a project that I am going to publish on github.

It’s roughly a library of templating engine macros and blocks to send collections of data (similar to a JSON format) and it builds the HTML favouring HTML+RDFa with abstraction of the CSS schema for implementation using this “framework of things”.

My question is mostly if any of you guys had been aware of already made such libraries.

What I am working on:

The main idea is to be able to exchange content, take from external source, cache in a “serialized” but text only (readable) way, then generate the html in the shema you want.

If you want to see in detail the big picture I want to attain using what I am searching, I suggest you look on the project manifest here.

Where I am at:

My current implementation is made in Twig using Symfony2/Doctrine2 with a WordPress database.

For the moment I have my site beta.renoirboulanger.com/ (not stable yet) which implements partly the first and the third part, you can see the code of the first part in this github repo branch, you can see how I am architecturing in this Wiki page.

So far, for the third part, I have only a few patterns using schema.org/BlogPosting and schema.org/UserComments and I am abstracting the css vocabulary out of it and making sure the templating library is as DRY as possible.

When I will have more than an incomplete BlogPosting+UserComments macros I will open the project on github.

Your input

As I said, I am mostly wondering if you have knowledge of any such implementation of set of macros that represents html in micro formats, be it in Python Django templating language, Mustach, Hogan, or anything.

Thanks!

How to implement a CollectionType Form field with AJAX “add new” embedded form with re-usable markup using Symfony2 and Twitter Bootstrap

I wanted to create a re-usable piece of code that makes me able to “add new” input field and makes the relationship with the other entity.

I did only find some very specific (and not re-usable) examples, so I gave my try on this question. Hope you find it usefull.

Here is how I did it, in some generic manner.

In generic, I mean, Any collection that I add to the form just need to follow the Form template loop (in a macro, for example) and that’s all!

Using which convention

Form Type class

The form template

Trick here is that I would have had used the original {{ form_widget(form }} but I needed to add some specific to the view form and I could not make it shorter.

And I tried to edit only the targeted field and found out it was a bit complex

My notes on Snipt.net

I created a Snipt to use on my Sublime Text 2 editor installation. In case you want to use it:

References

I wrote a complete answer, hoping to add some value on StackOverflow, here is some other paths I read about it.

    Résumé de mes essais avec composer sous Symfony 2.0.x et un manifeste composer.json pour vos propres tests

    Ce soir j’ai pris le temps d’essayer de configurer une distribution Symfony 2.0.x sous Composer. Je ne suis pas certain encore si j’ai totalement réussi. J’aimerai votre avis sur ma proposition de fichier composer.json.

    Statut mis à jour

    Je suis retourné avec le fichier deps à cause que je n’ai pas réussi a avoir toutes mes dépendances fonctionnelles dans un délai raisonnable (trois soirs). J’essaierai à nouveau plus tard.

    Résultat

    En ce moment je n’arrive pas a faire fonctionner JmsDiExtraBundle ni la nouvelle version de MopaBootstrapBundle notamment pour le mopa/bootstrap-sandbox-bundle. Je mettrai ce billet a jour lorsque j’aurai terminé mes essais.

    Résultat escompté

    Avoir un manifeste complet pour Symfony 2.0.x que je pourrai utiliser avec mes bundles préférés:

    • jms/security-extra-bundle
    • jms/di-extra-bundle
    • jms/serializer-bundle
    • gedmo/doctrine-extensions
    • stof/doctrine-extensions-bundle
    • knplabs/knp-components
    • mopa/bootstrap-bundle
    • knplabs/knp-paginator-bundle
    • polishsymfonycommunity/blog-bundle

    Composer.json file

    {
        "description": "This bundle is meant to run latest 2.0.x Symfony-standard distribution, based on Composer.",
        "keywords": ["symfony2"],
        "type": "symfony-bundle",
        "license": "MIT",
        "authors": [{
            "name" : "Renoir Boulanger",
            "email" : "[email protected]"
        }],
         "autoload": {
            "psr-0": { "": "src/" }
        },
        "require": {
            "php": ">=5.3",
            "symfony/symfony": "2.0.*",
     
            "twig/twig": "1.6.*",
            "doctrine/orm": "2.1.7",
            "doctrine/common": "2.1.4",
            "doctrine/dbal":   "2.1.7",
            "swiftmailer/swiftmailer": ">=4.1.7",
            "monolog/monolog": "1.0.*",
     
            "symfony/assetic-bundle": ">=1.0.1",
            "sensio/distribution-bundle": "2.0.*",
            "sensio/framework-extra-bundle": ">=2.0",
            "sensio/generator-bundle": "2.0.*",
     
            "jms/metadata": ">=1.1.0",
            "jms/security-extra-bundle": "1.0.x",
            "jms/di-extra-bundle": ">=1.0.0",
            "jms/serializer-bundle": "master",
     
            "gedmo/doctrine-extensions": "v2.2.2",
            "stof/doctrine-extensions-bundle": "1.0.2",
            "liip/imagine-bundle": "master",
     
            "knplabs/knp-components": "1.1.*",
            "mopa/bootstrap-bundle": "2.0.*",
     
            "knplabs/knp-paginator-bundle": "dev-master",
            "knplabs/knp-menu-bundle": "dev-master",
            "mopa/bootstrap-sandbox-bundle": "2.0.x-dev",
            "liip/theme-bundle": "dev-master"
        },
        "config": {
            "bin-dir": "bin"
        },
        "extra": {
            "symfony-app-dir": "app",
            "symfony-web-dir": "web"
        }
    }