You are in: seo sef

Embrace REST: sfRestWebServicePlugin

During this weekend, I've been committed developing a simple plugin ( firstly only intended for studying purpose, then... well, here we are ) for symfony 1.4 which lets you expose REST web services based on your domain model.

The code of sfRestWebServicePlugin is available on GitHub ( seriously, how ... amazing are Git and GitHub? ) and I'll also add there some TODOs.

If you have a quarter to spend with the plugin, any feedback ( bug, design, best practice, awesomeness, suckness Smile ) will be appreciated.

OSS business models: the video

Hello folks,

the wonderful guys from Develer have published the last videos from the Better Software 2010 conference, including my talk about open source business models.

It is ridicolous...

...that FIBA's dance team has been benched to agree muslim's costumes.

Focus on how those girls feel now because some dumb people involved in the organization didn't remind how muslim's view works.

After decades... skype + ubuntu

After lot of time I succesfully configured my office laptop to record the mike for skype.

Nothing too complicated, just:

sudo alsactl store
sudo vim /var/lib/alsa/asound.state

and then changed the Mic Switch values ( 0 and 1 ) from false to true.

After that:

sudo alsactl restore

and the job it's done.

So...

Yes, summer holidays. Smile

Italian taxes on the bash

Drasa is a simple tool I built this morning with bash scripting: it helps you calculate an amount of taxes given your (annual) total incomings.

Its aim's not to be perfect, nor to be a business consultant, but using it you can get an idea of how much you'll spend in taxes in Italy.

Please read the README that is far more explanatory.

Basic Git branching

Git is a new generation CVS originally developed by Linus Torvalds ( yes, him ).

I do not want to focus on why you should migrate from SVN ( or other similar tools ) to Git ( I'll do it in another post ): today I want to share a couple commands to easily ( for dummies ) understand how to work with branches under Git.

READ MORE

Be a SOLID PHP programmer

This is not a true article, just a reminder to myself: I will ( need? ) to blog about the SOLID principles

  • single responsability
  • open/closed
  • Liskov substitution
  • interface segregation
  • dependency inversion

and their implementations in PHP.

Add a default NOW() value to a date field

Today I've discovered that when assigning default values to columns Doctrine, for DATE and DATETIME column types, doesn't magically handle the default values like NOW().

This due to the incapsulation of the default parameter into the double quotes.

Not a big deal, if you want to override this behaviour you simply need to redefine that column in your record's class ( lib/model/doctrine/MyModelObject.class.php ):

 

public function setTableDefinition()
{
  parent::setTableDefinition();
  
  $this->hasColumn('scheduled_for', 'date', null, array(
       'type' => 'date',
       'default' => date('Y-m-d'),
       ));

public function setTableDefinition()
{
  parent::setTableDefinition();
  
  $this->hasColumn('scheduled_for', 'date', null, array(
      'type' => 'date',
      'default' => date('Y-m-d'),
    )
  );
}

and you'll be able to get a default value corrisponding to NOW() for you rows.

"A bad open-source software can be improved, not thrown away.

A closed-source one can only be sent to the trash."