Akahgy
MY BLOGS
-
Justbugs: Coding Solutions in a Snapshot
http://justbugs.wordpress.com/
Offering quick, short and objective solutions to nagging everyday coding bugs.
LATEST ARTICLES ( 63 )
-
Create Service Class in PHP with Zend Framework
Description: Communicate between modules in MCV architecture like PhP’s Zend Framework. Solution: Communication between modules, in MCV architecture should not... Read more
Posted on 31 July 2012 COMPUTING -
Zend Framework Coding Standards
Description: Guideline for coding in the Zend Framework. Solution: Use the following coding standards, derived from the original coding standards inherited... Read more
Posted on 10 July 2012 COMPUTING -
GIT Merge Branches
Description: After finishing work on a branch we need to merge it to the original project or with another branch Solution: Checkout and pull main branch. Second... Read more
Posted on 10 July 2012 COMPUTING -
GIT Create New Branch from Clean Environment
Description: Create a new branch from GIT command line Solution: Start with a clean environment: > git status Checkout main branch: > git checkout –trac... Read more
Posted on 10 July 2012 COMPUTING -
Adding Correct phpDoc
Description:Each class or method should include the php documentation at the beginning of the definition.Solution:The average phpDoc for a PhP class should... Read more
Posted on 21 June 2012 COMPUTING -
Run Update SQL Query with If Clause
Description: Running an SQL script that performs a update depending on some given conditions. Solution: SQL query can take if clauses in the shape of cases:... Read more
Posted on 25 May 2012 COMPUTING -
Export HTML to PDF
Description: Export a HTML page to PDF in PhP Solution: The best solution is installing a 3rd party tool like wkhtmltopdf . The tool is easy to install on... Read more
Posted on 25 May 2012 COMPUTING -
Add Special Characters to CSV Export in PHP
Description: When exporting data to CSV, the special characters are not displayed, as the ending ; is treated as a new column. Solution: Check the encoding of... Read more
Posted on 18 May 2012 COMPUTING -
Parse CSV File in PHP and Retrieve Contents
Description:Retrieve CSV file contents in PHP.Solution:The parsing is done in 2 steps. First read the .csv file:$handle = fopen(“file.csv”, “r”); $csv =... Read more
Posted on 04 May 2012 COMPUTING -
Recreate Date and Time from a Timestamp in PHP
Description: Reconstruct readable date and time from an integer timestamp. Solution: We have to use the date() function of PHP. Read more
Posted on 04 May 2012 COMPUTING -
Iterate Array Contents in Smarty Templates
Description: Iterate an Array passed as a variable in a Smarty template Solution: The equivalent of foreach() clause in PHP translates as section in Smarty... Read more
Posted on 04 May 2012 COMPUTING -
Check Regex
Description: Which are the best regular expression testing tools online? Solution: http://gskinner.com/RegExr/ – offers great support, samples, history and has ... Read more
Posted on 04 May 2012 COMPUTING -
Increase phpMyAdmin File Import Size
Description: phpMyAdmin allows by default a maximum upload size of 8Mb for importing a sql file.This can be sometimes too small. Solution: The maximum import... Read more
Posted on 30 April 2012 COMPUTING -
XAMPP Cannot Start Apache Server
Description: Cannot start Apache server from XAMPP Control Panel. Solution: First source of the problem is usually that the port 80 is in use by other... Read more
Posted on 30 April 2012 COMPUTING -
Save an Array into Database Table
Description: How to save an Array variable as a regular database value? Solution: PHP offers the serialize() function, that creates a representation of the... Read more
Posted on 24 April 2012 COMPUTING -
Ajax Call Forces Redirect from HTTPS to HTTP Return 302
Description: Calling an Ajax request from a HTTPS server redirects to the HTTP server causing a 302 redirect return message if the HTTP and HTTPS servers are... Read more
Posted on 23 April 2012 COMPUTING -
Send Emails with Attachment in PHP
Description: How to send e-mails with attachments from a PHP script? Solution: The mail function of PHP supports also attachments. So, in creating the mail... Read more
Posted on 12 April 2012 COMPUTING, HOME, PETS -
Hide HTML Fields with Javascript
Description: Hide or show different HTML fields when markup is changed. Solution: There are 3 aspects to take into consideration. First, we have to identify... Read more
Posted on 29 March 2012 COMPUTING -
One Line If / Else Clause in PHP
Description: Create an “if / else” check in one line. Solution: For assigning a value, or triggering a special function based on an “if / else” clause we can us... Read more
Posted on 29 March 2012 COMPUTING -
Pull Single Commits with GIT Cherry Picking
Description: We need to pull into a separate branch a few number of commits from another branch. Solution: GIT version control tool offers the solution: cherry... Read more
Posted on 28 March 2012 COMPUTING