Fork me on GitHub

Welcome

Welcome to iamjeff.be
I'm Jean-François Lefebvre, a passionate PHP/mobile developer living in Brussels, Belgium. This is my technical blog where I'm experimenting and sharing my ideas or findings with the world. Feel free to check v2 which is my sandbox where I play with Silex and various REST APIs.
If you like pinterest and are looking for a script to build a page with your pins, you should check my pinterest page, the code is available on github .
Don't hesitate to contact me.

Blogs

v2 sandbox

Feel free to check v2 which is my web development sandbox : I'm playing with several technologies and I'm building a web app allowing to configure and deploy rapidly a web site with social media integration and being able to be extended as needed. And of course, it's built lean with Silex and the best of open source software.

Using PHP on infomaniak cloud server shell

Infomaniak cloud server is a very nice environment to deploy your web applications.
Here is a tip : to use PHP and especially install composer you must provide the -d option

Install composer

curl -s getcomposer.org/installer | php -d detect_unicode=Off

Install your project dependencies

php -d detect_unicode=Off composer.phar install --prefer-dist --no-dev

The SDK Build Tools revision (19.0.1) is too low for project after android studio update

If you update android studio, gradle could display the following message when you try to clean or build your project :

The SDK Build Tools revision (19.0.1) is too low for project ':app'. Minimum required is 19.1.0

To fix this, install the SDK Build tools if it's not yet installed via the SDK manager and go to your module settings (click right on your project and choose open module settings).
Then in the properties tab on your module, update the value in Build Tools Version.

PHP : remove duplicate elements from a multi-dimensional array

"array_unique" removes duplicate values from an array. Unfortunately it doesn't work with multi-dimensional arrays.
A quick workaround is to serialize all elements of the first/parent array in order to make it unidimensional, let "array_unique" doing its job and then unserialize it back.

$uniqueArray = array_map("unserialize", array_unique(array_map("serialize", $nonUniqueArray)));
 

android config

Cyril Mottier has a great post about getting a productive android development environment. It's really useful to find the best tools to avoid frustration that can come with android tools especially the emulator and tips to make things easier and faster when you are developing or even learning to create android apps.

Basically he uses three things :

  • genymotion which is a fast virtual device based on virtualbox to replace the default emulator.
  • android studio : using eclipse can be painful, slow and sometimes even crashes. Android studio is based on IntelliJ IDEA and can be a good alternative. It's still under early access preview.
  • Gradle can automate the building, testing, publishing, deployment and more of software packages or other types of projects such as generated static websites, generated documentation or indeed anything else. It combines the power and flexibility of Ant with the dependency management and conventions of Maven into a more effective way to build.

So, I've updated my environment and play around with all these new tools.
I think that switching to an SSD drive can improve A LOT your daily experience as a developer. I've seen a lot of BEFORE/AFTER videos on youtube and it's really impressive to see the improvement that it can bring.

Stripe : A REST API documentation beautifully crafted

Stripe is a suite of APIs that powers commerce for businesses of all sizes. You just have to register and with several lines of code you can implement a simple form in your web site to accept payment.
The thing that struck me on the back-end and the API is the stunning beauty and attention to every detail.
It seems that they have implemented their own REST API documentation generator, there is some open source packages to generate documentation but nothing close
to the following documentation in terms of awesomeness. SAMI does a pretty good job, but generating documentation for REST API requires a tool specialized.

Stripe : A REST API documentation beautifully crafted

The Wolf of Wall Street VFX Highlights

A look at some of the more challenging shots put together from Martin Scorsese's new film The Wolf of Wall Street, starring Leonardo DiCaprio, Jonah Hill, and Matthew McConaughey.

android throwing NetworkOnMainThreadException when trying to open a socket

I'm currently improving my inspiration widget and it stopped working on nexus7.
With android api >=16, it throws an NetworkOnMainThreadException when I try to make http request.
If you want to make it work, you must execute your code in a thread.

new Thread(new Runnable() {
            public void run() {    
                try { 
                        // your network related code
                }catch (IOException e) {
                } 
          }
     }).start();

Source; Stackoverflow

Nexus 7 - Inspiration widget - hello@e-volution.be

How to enable developer settings on the nexus 7

Very weird, but google has hidden the development settings on the nexus 7 by default.
To get them back :

  1. Go to the settings menu, and scroll down to "About phone." Tap it.
  2. Scroll down to the bottom again, where you see "Build number."
  3. Tap it seven (7) times. After the third tap, you'll see a playful dialog that says you're four taps away from being a developer. Keep on tapping, and then at the seventh tap you will receive a final message telling you that you are a developer now.

A new item is now available in the system section of the main settings to change the development settings.

Syndicate content