small PHP check before upload or test

In a world where Bash shell is under attack I attach a short shell script that make me waste less time in upload/commit/test loop:

#! /bin/sh

LIST=`find . -name '*.php'`
for  x in $LIST; do
    OUTPUT=`php -l $x`
    A=$?
    if [ $A -ne 0 ]; then
	echo "ERROR ON " $x "with " $OUTPUT;
    fi
done

simple enough as running

./php-lint.sh

on a git repository, do not traverse all tree but just the changed files, and launch just before commit the script

What is ELPA? and some hint on editing PHP with emacs

Emacs Lisp Package Archiver, simply a way to install emacs lisp script on emacs without wasting time on download, put where it could be loaded, load it ...

It just install the package and let you use it. Command is M-x package-install RET [and choose the package].

It will install the package in the ~/.emacs.d/ELPA folder.

http://www.emacswiki.org/emacs/ELPA

Some usefull php el editing packages:

Tags: 

TDD or not TDD? This isn't the question.

Instead of reply to these reasons:

http://www.phpclasses.org/blog/post/237-7-Reasons-Why-TDD-Failed-to-become-Mainstream.html

I prefer to find what make testing hard: mock object, the missing part!

All these arguments seems to fail to understand that TDD is not just testing, it is to guarantee SOLID principle of object oriented design

Tags: 

Use Grunt. Always

The worst could happen, but use grunt. Always.

A little lesson from wasted time.

Code could be wrong, thus it has to be tested, and tested, and tested. Automate that test. Do not wait to waste any more time.

A note on grunt is that shell can do the most, for example lftp is very good:

 

grunt.initConfig({
  shell: {
    upload: {
      command: 'lftp -e \'put ./myfile.tar.bz2\' ftp.mytargetsite.com'
    }
  }
});

 Is better than use grunt-ftp, or grunt-ftp-deploy, or whatever.

JsDay, news from the front. (and back end)

If I should rate an event from the front end I thing I should consider the UX. In this field JsDay has 10/10 as UX: location is easy to reach (once you are in Verona), food are good (missing salt from meat, they are salutist), very clean and comfortable, you get what you want and need, coffee breaks spans during the day in a regular basis, free bottled water (very valuable thing) and kindly hotel's and organization's staff.

php composer: npm like tool

A good introduction to the php composer:http://www.phpclasses.org/blog/post/221-Speedup-Your-Web-Deployments-Using-Composer-to-Install-PHP-Classes-Packages.htmlThe site https://packagist.org is where to post package.It is almost a clone of npm and I like it.Image: it came from getcomposer site, from 

Tags: 

Display online pdfs attachment in drupal with pdf.js

pdf.js (https://github.com/mozilla/pdf.js) is a mozilla project for rendering pdf files with javascript.

Now it came with a standard Firefox download, but not everyone is using Firefox, thus it came the drupal module: https://drupal.org/project/pdf

Simple steps:

Little tool spot (php to UML)

This is my little endorsement to this tool

http://tech.motion-twin.com/php_php2xmi.html

really usefull to extract uml from an existing PHP project. In GNU/Linux system (actually Bsd world too) there is at least Umbrello which read and write XMI format.

Tags: 

Twitter Insecure by Design

It happens I have a new identity ... no, someone has my credential or such for using my twitter account. Twitter does not reply, there is no team that can fix it.

Problem with twitter is that it is insecure by design. You indicate an email address and confirm it, at registation time, or whenever you want.

Well, now? If you want to change email address you have to confirm it with the old, confirmed one, email, you are guessing ... no. You have to verify the new email address with the new email address!!

Runyourjs drupal module

Done, as said in http://www.smartango.com/blog/upload-javascript-attachment-drupal-entity-and-run-it-and-what-it-munge, I created a sandbox project:

https://drupal.org/sandbox/smartango/2034907

I attach here an archive as git archive --prefix=runyourjs/ HEAD |gzip - > ../runyourjs.tar.gz