Fund Raising For SFCON’2012 in BH, Brasil, HELP PLEASE!

Good morning,

as you may have heard we are very interested to attend the Symfony2 Conference in Brasil
http://www.sfcon.com.br/2012/index.php (1 day event in BH, Brasil)

we are looking for supporters and sponsors that would help us pay for our air tickets ($850 x 2 community participants)

If you are interested in supporting us we would in exchange provide you with:

– marketing x at http://phpperu.org

– marketing x twitter @php_peru

– marketing x facebook community page http://www.facebook.com/pages/php_peru/164660603648081

– special acknowledgement in our next presentation (in codepassion.pe event and others)

– logo in the new version of our phpperu t-shirt or stickers (old version is almost running out), we always use it to present on events (coding dojos, trainings, etc)

– we can also represent the company in an event handing flyers or propaganda or helping organize future events

– we can serve as recruiting channel also picking up CVs etc

We will have a meeting after even to report our experience and also it will help us organize future php community events.

Please let us contacting Luis Cordova at cordoval@gmail.com

PHP Symfony2 Peru Community here we go!

PHP Coding Standards Fixer: Let’s Put It To Work!

Nice i just embedded php-cs-fixer for my project. I git clone it to a ../php-cs-fixer dedicated git folder so i can update and have it permanently symlinked as /usr/bin/php-cs-fixer. Then I created my .php_cs like in the instructions on the github readme page. Then i ran into problems and comparing to what the –config=sf21 does I wrote my own .php_cs:

<?php
use Symfony\CS\FixerInterface;
 
$finder = Symfony\CS\Finder\DefaultFinder::create()
    ->exclude(
        array(
                'Vendor/DemoBundle/Resources/public/js',
                'Vendor/DemoBundle/Resources/public/img',
                'Vendor/DemoBundle/Resources/public/css',
        )
    )
    ->in(__DIR__.'/src')
;
 
return Symfony\CS\Config\Config::create()
    ->finder($finder)
    ->fixers(FixerInterface::ALL_LEVEL);
;

Then you just run it like a boss:

~ php-cs-fixer fix .

Performance review: Make sure you add that src limit so that it will not take forever to scan your vendor folder.
In addition I noticed that the main changes on my code were the removal of use statements, the addition of space lines and removal of wrong ordered things like `public static` from `static public`. Other than that I guess I bet it is going to get more fixers as they come available from contributions.

Now to continue with the project by His grace.

5 days to kiss bye bye to PHPStorm

Because license is expiring PHPStorm although good looking and increasingly fast has to go too like all things. It cannot stay for long. So I decided I will switch to vim. This has to also do with the fact that doing pair programming with teamviewer7 is getting heavy for my hardware and network. Wemux/tmux provide more freedom and focus on the actual code and things so I am doing the switch. I asked some friends about I conclude vim has to be and not a secondary replacement like sublimetext2 which is also not free like phpstorm. So this has to be if not what are we teaching after all new developers? I hate to see my symfony2 colors gone but once I become more proficient with vim I can start coding to get the same colors in vim.

One can read this and install plugins and follow instructions including what is said on the comments to solve pitfalls. So far is good the only thing that bothers me now is the file navigation and correct indexing of all files in projects.
http://lenss.nl/2011/04/vim-for-a-php-developer/

Now let’s take a look at this repo here:
https://github.com/tobyS/vip

After some tests trying to clone everzet/ornicar dot files and symlink the vim and vimrc to my dot versions on my home I failed because they use macs. I wish someone could point me to similar dot files for ubuntu/linux. Anyway, I will soon leave phpstorm.

I left it: https://github.com/spf13/spf13-vim This link just settled it for me, no more looking.

Update: I bought my license for $99 finally :D. I will still learn vim and also will try to do a symfony2 colors theme on eclipse with pulse00 plugins to just compare (http://www.eclipsecolorthemes.org/)

Two-way Wemux-based Pair Programming: Part II – The One You Die To See

On our previous post we saw how to configure a default wemux session to pair program in mirror mode. In this post we will see how to switch to rogue mode so that we can have two terminals in our ubuntu or linux machines that can monitor one on the right and one on the left. The right one will display a shared view/edit session belonging to one programmer and the left one will display a shared view/edit session belonging to the other programmer on the other end.

In order to do this we configure the wemux.conf file:

sudo pico /usr/local/etc/wemux.conf

Here we switch the flags to support rogue mode and switching to servers as described in the text in there.

As default wemux only creates one session and expect everyone to reuse this session in a single host/server. In order to create more than one session we follow the series of commands as follows:

wemux list-sessions  // list sessions
wemux -S /tmp/wemux-wemux new-session -s checarlitos // creates new session named checarlitos
wemux -S /tmp/wemux-wemux attach-session -t checarlitos // attach to a previously created session named checarlitos

Following the creation of two sessions in separate terminals we put them side to side. In one we attach to one session and in the other to the other session. That is it!

Learn to pair program with wemux like the top Symfony2 devs

If you have been around long enough you have probably heard about wemux or tmux. The thing sounds very confusing and the readme on wemux github repo does not make it any easier to newbies like us. But I was stubborn enough to get the first human newbie readable information on what this is and how it works and how it can help. And also where I got stuck and need some real help.

So the first thing is of course to clone the repo and start following the first manual installing instructions from the reamde at https://github.com/zolrath/wemux.
The second thing is when you realize and say “what is this thing?” or “why am I doing this?”. Basically wemux is a wrapper like cli tool sitting on top of tmux. What is tmux? tmux is a terminal multiplexer tool, it basically allows splitting your windows into several panes and hook sessions with different users. You could just use tmux alone, but why trying to show off something we don’t know about? Let’s just use wemux, wemux saves us to do some hard work on tmux or so we think. So after setting everything wemux readme says we should we are still at odds because we want to know how do I tell my friend to pair program with me? Well, the thing you want to do is to first have a way your friend can connect to you and look up the same code via ssh to your computer. Then you both can edit the same file or different files at the same time in different panes. For that you would need a bit of setup.

Third thing, you want to make sure your IP is reachable by your friend. So you “port forward” from firewall to your ip on the inside. The port to forward is 22 from your router to your computer. This can be done by opening a browser on 192.168.1.1 and configuring your router ADSL or other to forward a port. If you cannot figure out where that option is it would be good to take a look at your router manual.

Fourth thing, because your ubuntu or linux box is running a firewall you need to open up to forward that port 22. This advanced stuff can be summarized with the following command:

sudo iptables -L -n | grep ACCEPT  // this is just to see what is there
sudo iptables -A INPUT -p tcp --dport ssh -j ACCEPT  // this one is the real stuff that makes the difference

This command opened the firewall on my box for the ssh to not timeout. Now an external user, my friend can join my box. However he does not have a user account yet!

Fifth thing, now we create an (ssh) user account into my box.

~ sudo adduser mark
Adding user `mark' ...
Adding new group `mark' (1002) ...
Adding new user `mark' (1002) with group `mark' ...
Creating home directory `/home/mark' ...
Copying files from `/etc/skel' ...
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully
Changing the user information for mark
Enter the new value, or press ENTER for the default
	Full Name []: Mark
	Room Number []: 
	Work Phone []: 
	Home Phone []: 
	Other []: 
Is the information correct? [Y/n]

Sixth thing, now I run:

wemux start
wemux users
// then use your vim or pico editor to work on your files
// and also use tmux commands to split or do work with your panes

Tell your friend to ssh you using the ip you see in http://www.whatsmyip.org with his user and password and then ask him to try to attach to server or join you. His username has to be in the host_list or such. He then can pair program with you!
Now I have problems with the pair mode, it seems everytime my friend connects it goes into mirror mode. How to solve this?

Special thanks to my friend Mark Badolato.

Doing better than what I deserve by the Lord’s grace!