Posts tagged with tips
Just want to note down my experiences when doing unit testing with Laravel.
Use Mockery to mock all the dependencies if possible to save time when executing the tests.
Database Testing with Sqlite (in memory)
If the tests involve a very complex SQL query/database, then should first try to do the testing using SQLite in memory. This will speed up execution time a lot as the database will be destroyed and re-created every time a single method runs. A database running in memory will speed up the process.
However, there are some...
This is just to document some setup issues and notes for Raspbian Wheezy:
Upgrade and keep software up to date
$ sudo apt-get update $ sudo apt-get upgrade
$ sudo raspi-config
# install vim $ sudo apt-get install vim # install LAMP $ sudo apt-get install apache2 $ sudo apt-get install mysql-server $ sudo apt-get install php5
Keyboard Issues & Fixes
I keep having problems initially when press certain characters such as |, ~ does not appear correctly. The fix is to change keyboard locale to...
Recently, I have read about search engine optimizations. I am quite new to this game :) It is quite interesting. Previously I was only aware about on-site optimization techniques. Basically, we could optimize the followings for our website:
- Friendly URLs containing keywords
- Friendly HTML titles, meta tags, keywords & description
- Image "Alt" tag
- Hyperlink anchors to contain the keywords
- Include keywords in headers (h1, h2,h3)
- Do internal linking
- Have a proper sitemap.xml
The more interesting aspect...
In my experiment with CasperJS to extract the data from an aspx page, I faced some issues with dynamic drop-down. What happened is that there can be 2-3 dropdowns box that depend on each other e.g. User selects a category in dropdown1 , an AJAX request is triggered to create and populate sub-categories in dropdown2.
My first reaction to this problem is to use Chrome Network Tool to capture the POST request when the form is submitted to find out all the parameters. Then, I attempt to simulate this by filling the form with all the...
Recently, I have been playing around with CasperJS and PhantomJS for web scraping. I always find screen scraping fun and fascinating. I mean there are just so many applications:
We have bills/accounts all over the place in different websites. The scraping tools can be used to develop a program for personal use that can combine the results in a single place. It also can be used to trigger notifications e.g. bill payments reminder, manga notification, movies notification. The possibility is just endless :)
We want to find and compare the...