Skip to main content

Spare time projects; a game in JavaScript


Recently I made some small and medium projects which almost all of them have been done in my spare time. For example in base converter case;  I finished my maths assignment few weeks before the deadline and got bored, and then I decided to write an algorithm which could do what I did by hand for base converting. Basically my classmates could check their answer with this algorithm which l coded with PHP and Java. The PHP version is online here. There are some base converters programing online however, most of them do not work with decimal number such as 102.3 from base 10 to base 5 (This was exactly a question in the assignment).


Few days ago, my broadband internet connection lost so I really get bored, as above I should do something. If there was internet connection, I probably watch cat video on YouTube (just kidding, however I do sometimes) or reading blogs and interacting with other people, nevertheless there is no internet. So I could play a computer game, wait! why not make a computer game? There you go. 
There was a game which I used to play when I was very young, so I decided to make the computer version of that game. There are 9 boxes and each box has number from 1 to 8 and there is an empty so the task is: you should sort them.  The rule is that you can only move the number which is next to empty box. 


I coded this game with JavaScript (HTML and CSS). By doing this small project, firstly I filled my spare time with something which I really like to do, secondly; I illustrated my JavaScript skills as well as being creative.  There are many functions which I could add to this game, for example “track user activity” and “save user point, time taken”. To do this, I could use PHP and MySQL which is easy for me to do such, unfortunately internet back and I return to watch YouTube video but this time, not cat, similar to cat one.  


Below are some of my recent work (full list on my website

Facebook app(MehdiX) 
Currency Converter 
Google guitar 
Dynamic Catalogue 
Database 
PHP quiz 
Base Converter 
SHA-1 generator 
MD5 generator


Popular posts from this blog

I solved GCHQ puzzle and this is how I did it

Today, I was reading the BBC news and I stumbled upon this GCHQ puzzle:
Take the digits 1,2,3 up to 9 in numerical order and put either a plus sign or a minus sign or neither between the digits to make a sum that adds up to 100. 

For example, one way of achieving this is: 1 + 2 + 34 - 5 + 67 - 8 + 9 = 100, which uses six plusses and minuses. What is the fewest number of plusses and minuses you need to do this?

I love to challenge myself with these kind of puzzles, so I solved this and here is how:

We have 9 numbers [1 to 9] and also we have three possible separators [+, - and nothing] which to fill the gap between numbers we have 8 combinations of separators, e.g. we have 1+2+3+4+5+6+7-89 which in this case we have six times plus, one minus and one time nothing.
So, I need to find all possibilities of combination which total is: 6561

Then, hook the possible combinations into numbers and check the total, easy enough. Now print the solution.

I have written this algorithm in PHP but easil…

Why Prestashop needs improvement for large application?

I have worked with Prestashop 1.6 long enough to know inside/outside of the application and even I developed few modules myself, all is simple and great but in small scale. My application is big, I am talking about millions rows in database. Two databases weight almost 18G (see the picture).

One day at 2AM I received a notification that my website/application is down. I looked at the server the application seems OK but the databases gone crazy big, (see the picture) it has gone from 18G to over 90G less than 6 hours. 
Since there was almost none free space left on the server, all server running really slow even I could not restart NGINX. All was frozen. All my websites/applications run on dedicated server on UKFast, so none of websites would work because all is glued together. 
There are many issues here, e.g. the server infrastructure is wrong (I know that already), there should be monitoring service in place which there was no such thing (I know that too) etc. but why this happened,…

Prestashop + Symfony

I have not been blogging for quite long time (three years ) and now again started to blog and share my thought and experience with like minded people.

I am happy to write my first post after long time about Symfony and Prestashop. When I heard that Prestashop introduced Symfony into their application I was really happy to hear that because it definitely boost Prestashop. I know this because I have many years experience with Symfony as well as Prestashop, even these days on daily basis I work with Prestashop and Magento.

Here I don’t want to compare Prestashop with Magneto (I will do in another post) but I can tell you from my experience that Prestashop is lacking from good robust infrastructure such as Symfony.

Why Prestashop is good with Symfony? I will answer in coming post but before this just to let you know that for now, Prestashop used Symfony in some parts of application not 100%, only in back-office although there is a plan to slowly use in front-office too.

I know some develope…