Archive for the ‘tips & tricks’ Category

Which framework to use in PHP

Thursday, April 20th, 2017

While doing my freelancer projects I keep on monitoring what frameworks are out there. I have been working with Java for many years but have landed on PHP as smaller projects are much faster and easier to get off the ground.

The more I observe Google Trends the more obvious it gets that Laravel is coming here to stay. Only framework that has trouble dying is Symfony and it could also be because of Laravel. Not much else is needed to say that only one picture and all is clear which PHP framework you must learn if you want to be among the best.

Thinking fast and slow

Wednesday, April 30th, 2014

Thinking, Fast and Slow by Daniel Kahneman  is a very long with book 533 pages and it is packed tight of useful scientific text. Although this book is a goldmine it takes a long time to process.

Once you have finished reading this book you know all of the most common judgement errors that everyone should know. You should be able to raise a red flag when you are about to make decision on shaky grounds.  This book will open your eyes and all the decision making mistakes will be especially obvious on other people.

I will list just a few examples in here

  • Cognitive ease – if it feels familiar then it feels true
  • WYSIATI – if you know only 2 facts out of 100 then you feel like 2 facts is all there is. You will make decision only based on these 2.
  • illusion of control – stock market experts believe that they have upper hand while statistics shows that majority is not doing any better than general indexes.
  • framing effect – If drug saves 50 people out of 100 then it is much better you say that drug kills 50 people out of same 100
  • duration neglect and peak-end rule – You think that 30 days of vacation in Cancun is 10x better than 3 days. However a bit later it does not make much difference in the memories. If 30 days of vacation is ended with 2 bad days then all of the vacation feels bad.

There are many more situations explained in this book. I gained a lot of valuable understanding and I feel significantly more confident about mu skill of making decisions. Or should I not because self-confident experts should be trusted only if they have considerable experience which still needs to be gained after reading this book? 🙂

Simple Erply and Magento integration plugin

Tuesday, April 1st, 2014

Recently I helped a company to build e-commerce website with Magento. She had existing shops already and she uses Erply with almost 10000 items which she wanted to import into e-shop.

Even though Erply and Magento both are market leaders then importing the data from Erply to Magento was poorly supported. I took existing github project, forked it, upgraded to magento connect version and fixed many issues in it. It is still not fully stable but usable, expert help is still advised. You download the plugin from here https://github.com/smartman/magento-integration

Simplest way to integrate Erply and magento is to:

  1. Install Erply plugin from Magento Connect service http://www.magentocommerce.com/magento-connect/erply-inventory-management-for-magento-1.html
  2. Download source of fixed plugin from https://github.com/smartman/magento-integration/archive/master.zip
  3. Copy/merge folders design, code and etc from magento-integration-master/erply/app/ to app folder in your magento installatation. This overwrites old broken files.
  4. Enjoy

Issues fixed are:

  1. Missing price, description and some other fields import
  2. Fixed big number of product import
  3. Fixed category import
  4. Many more small things

Issue with large number of product import was that it takes very long time. PHP script execution may time out and process never finishes. (more…)

Best measure to get more successful startups.

Monday, September 23rd, 2013

startup-curveWhat is the biggest problem causing many great people not to start successful startups? The answer is making the first step out of safety of good salary and into uncertainty with no income. How government can help to resolve the problem? It is actually very easy, support similar to unemployment benefits will help.

Here is my suggestion. Support is best suitable for top notch specialists identified by well above average salary and business in IT area where most of expences are salaries. For applying is needed process similar to accelerator application. It is required to have Business Model Canvas plus answering a few business critical questions followed up by interview with government specialist. Government will get around 10% of company shares in return of support so the money is not totally free.

Once approved then new entrepreneur will get enough money to survive for 6 months if he leaves his previous job. Each month he must meet with government specialist and update on business progress. Government evaluates progress and decides whether to continue making the payments.

 

 

Never do sudden changes in Google or Facebook ads

Friday, December 21st, 2012

Lets say you are running low budget campaign and new ad starts to perform really well. You want to increase budget to take use of it but if you do it without thinking then you will jsut waste your money.

I had Facebook campaign and it was running 2EUR a day.  Ad for my latest post related to end of world started to perform really well having CPM of 0.01EUR and it generated a lot of likes, comments and shares. Now I wanted to take use of it and increased budget 5 times from 2EUR to 10EUR. What happened is that after 15 minutes all of the 10EUR was spent, CPM went up from 0.01 to 0.11 and there was only a little extra action.

Please bear in mind that if you do changes to you successful campaign then to this bit by bit. Facebook and google advertisments engine will overcompensate and all of your money will be wasted.

Paypal [L_SHORTMESSAGE0] => Internal Error [L_LONGMESSAGE0] => Timeout processing request

Thursday, December 20th, 2012

Paypal error messages are very unfriendly. It can say “Timeout processing request” without delay like

2012-12-20 19:45:34 INFO - Paypal call: https://api-3t.sandbox.paypal.com/nvp?VERSION=74.0&USER=username&PWD=12345&SIGNATURE=12345&METHOD=SetExpressCheckout&RETURNURL=http%3A%2F%2Fttawidget.dev%2Findex.php%2Fpayments%2Fpaypal%2Fsuccess&CANCELURL=http%3A%2F%2Fttawidget.dev%2Findex.php%2Fpayments%2Fpaypal%2Fcancel&L_PAYMENTREQUEST_0_AMT=2.00&L_PAYMENTREQUEST_0_ITEMAMT=2.00&L_PAYMENTREQUEST_0_CURRENCYCODE=EUR&L_PAYMENTREQUEST_0_DESC=payment+description

2012-12-20 19:45:34 INFO - PayPal call response: Array
(
    [TIMESTAMP] => 2012-12-20T19:45:34Z
    [CORRELATIONID] => cdea44429896f
    [ACK] => Failure
    [L_ERRORCODE0] => 10001
    [L_SHORTMESSAGE0] => Internal Error
    [L_LONGMESSAGE0] => Timeout processing request
)

Actually this means that some parameters in request are not correct. Try to fiddle with params and consult official API docs to fix the call. Some docs can be found here https://cms.paypal.com/uk/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_SetExpressCheckout

Application code deployment from SVN with fast and simple rollback

Wednesday, November 28th, 2012

Most important thing in every new release is the rollback procedure. Once you discover issues in new version then you need to be able to swithc back to previous version until you work on a fix. I have developed shell script to handle the automated deployment process and which allows quick and simple rollbacks if there are no database changes that dont allow easy rollback. Main idea is to

  • download code from SVN, GIT or similar
  • copy all code to new folder
  • replace all configuration with environment related conf
  • use symlink to switch between code versions

Here is example script that handles the automated deployment for you  (more…)

Quality software testing guidelines (for startups)

Sunday, November 18th, 2012

Importance of software testing=quality assurance=QA cannot be stressed enough.  Here is experience from my startup regarding good quality testing process.

The goal of testing is to guarantee that the released code does not contain any critical issues. This is contrary to understanding that this is just finding as many defects as possible. There are 2 main types of testing: a) testing new features and bug fixes b) regression testing to validate that old code is still working.

Reporting defects

When issue is discovered then it is important that it will be very easily understandable and reproducible. Making extra effort to report issues in understandable format means that development team will be able to fix the issue much faster. Recommended format for reporting bugs is: (more…)

Error: redirect_uri_mismatch – Reset google authentication oauth api secret

Sunday, October 28th, 2012

I have a few webapps where I am using google login.  When you are running the app in different domain then you will get error like

Error:redirect_uri_mismatch
The redirect URI in request: http://mywebsite.com/ did not match registered redirect URI.

Also  you might want to create new app for google oauth2 login. Anyway it is for some reason very difficult to find the correct url, I always tend to end up in google apps page.

Here is the secret link  that solves all of your troubles

https://code.google.com/apis/console/b/0/

Access virtualbox shared folders from Ubuntu and fix ruined ubuntu installation.

Sunday, August 19th, 2012

If you are running Ubuntu virtualbox guest then you cannot access the shared folder under /media/shared with regular user. However you can fix this by adding your user to vboxsf additional group.

Important! make sure you append the additional group so that other groups are not removed! Run te command below as exactly as seen and replace you username. If the permission is not applied immediately then reboot.

usermod -a -G vboxsf username

In case you forgot flag -a then it is bad but not hopeless 🙂 (more…)