How to move complete site from one location to another using gdrive for heavy files via terminal

Author - Navneet Kashyap

Problem: How to move complete site from one location to another using gdrive for heavy files via terminal.


1.  Log on to server where site is hosted via SSH.

2. Make a tar.gz of folder/directory of your site located.

3. Download gdrive in Read more…

CakePHP | Using Elements for common code

Author - Rita

Problem: How to separate redundant piece of code from your view using cakephp 3.0.

Description: Let’s take an example. You have a list of products to display. We show products at many places such as

1. Show all products.

2. Show products of the specific category.

3. Show Read more…

PHP | Rename all the files in zip and then extract zip in PHP

Author - Kiran Preet

Description: In one of our PHP projects, we wanted to rename all the files in zip folder and then extract the zip.

The code for this is written below :

$zip = new ZipArchive;
$res = $zip->open($sourceFolder.’\’.$file);
for ($i = 0; $i < $zip->numFiles; $i++)
$filename = $zip->getNameIndex($i);
$arr Read more…

Moodle | New lang strings not accessible

Author - Kritika Sood

In Moodle we had declared some new strings in lang file of a plugin like this:

$string[‘LIBRARY_NAME’] = ‘E-Lab’;
$string[‘BOOK_READ_SUCCESS’]=’Congratulations on reading the book’;

We wanted to use it in view.php file of the plugin like this:

$result=Get_String(‘BOOK_READ_SUCCESS’, ‘plugin name’);

But the output was Read more…

PHP | How to merge multiple PDFs into single file using pdftk

Author - Webner

Using PDFtk we can merge multiple files into a single file using a command like this:

Example : pdftk file1 file2 output file3.

Sample code to accomplish the same using PHP is given below:

$outputPDFName = “mergeResult.pdf”;
$dir =”Files/GeneratedPDFs/”;
for($i =0;$i<sizeOf($arrayOfPDFFiles);$i++)
$multiplePDFs = $multiplePDFs Read more…

Moodle/Totara | Upgrade Moodle database after making changes to a plugin

Author - Webner

In one of our Moodle projects, we modified a plugin’s code to add extra functionality to plugin. The modification in plugin’s code was not reflected and Moodle showed the older version of plugin.

To solve this problem, we upgraded the Moodle database and changes in plugin’s code Read more…

Eclipse | Undo deleted file in Eclipse

Author - Parminder Kaur

Problem: Undo deleted file in Eclipse

Solution: We were working on a project in Eclipse. Accidentally one of the PHP files got deleted in which code was written. Eclipse does not use the Linux ‘Trash’ but keeps local history from where we were able to recover the file.

Follow these Read more…

Ubuntu 14.04 | Installing postgresql 9.4

Author - Webner

Follow steps below to install Postgresql 9.4 (instead of 9.3 for which sources are added by default in Ubuntu 14.04):

1.  Remove the previous PostgreSQL Version:

*Make sure that you firstly backup your databases.
$ sudo apt-get –purge remove postgresql-*
2.  Add Repository:
$ sudo add Read more…

ACORD Forms autofill

Author - Webner

We get this request from a lot of clients in US insurance industry who want to generate ACORD forms automatically, means they want data of corresponding insurance Policy and other objects filled automatically in the editable ACORD PDF. Most of the clients have their data in a CRM system like Read more…

java.sql.SQLException: Data truncated for column date at row 1

Author - Webner

You may face this exception while trying to insert data in a mysql table using hibernate:

java.sql.SQLException: Data truncated for column date at row 1

While there can be different reasons of this problem, in our case it was occurring because by mistake we were trying to insert Read more…

PGAdmin not retaining created connections on reopening (Ubuntu)

Author - Webner

If you are using PGAdmin version 1.18.1 on Ubuntu and it is not retaining connections that you create, all you need to is this:

A. Open command prompt and create file .pgadmin3 in your home folder

B. chmod 755 .pgadmin3

Now create a new connection, close pgamin and Read more…

Zoho Creator or PHP based solution?

Author - Webner

A lot of Zoho users want to extend the capability that Zoho CRM provides out of the box. For example, one of our clients wanted to build a custom Quote Generator. They initially wanted to get the customization done to default Zoho CRM Quote form but their requirements were not Read more…

PHP | Convert date from one format to another in php

Author - Webner

To convert date from one format to another we need to specify to php interpreter the format of our current value. See code below:

In statement below, we are providing date and format to DateTime::createFromFormat function so that function could know day, month and year values separately

$date = DateTime Read more…

jQuery Datatables | Reloading data after filter values are changed

Author - Neha Mishra

Suppose there are two filters on the screen:

Date from
Date to

We need to reload data of Jquery datatable based on changed filter values.
“ Datatable “ plugin for jQuery needs to be called by including AJAX call as shown below :

Suppose id of the button on which we have to Read more…

Execute Javascript code on browser back button

Author - Kritika Sood

Here is sample code to trap browser back button and execute Javascript code on this event:

if (window.history && window.history.pushState)
$(window).on(‘popstate’, function() {//when back is clicked popstate event executes
//code here will execute on back click

Webner Solutions is a Software Development Read more…

Salesforce | Visualforce Component to AWS S3

Author - Webner

Description :

To access the features provided by amazon for storage and cloud computations from a visualforce component , the S3 service uses information from the form’s input fields to authorize uploads, and to set the properties of uploaded file objects.

To get Authorised make sure you got the object and Read more…

jQuery and HTML5 validations together

Author - Ishpreet Kaur

When we use HTML5 validation on form fields like required attribute, input type email, pattern attribute etc, then form data is not submitted until all HTML5 validations are passed. But if we associate some jquery code to the submit button then form is submitted ignoring HTML5 validations, which can be Read more…

Java | Execute SQL script using Maven

Author - Rita

Whenever there is a change in the database whether we are altering database structure or adding/updating data inside database most of the times we create a script file and run it manually. We can automate this process using Maven.

Solution: Maven provides a plugin called flyway-maven-plugin to Read more…

PHP | strpos() and result compare

Author - Webner

strpos($wholeText, $findText) in PHP returns position from which the $findText value starts if it is present in $wholeText. If it is not found then this function returns false. Fun starts when text is found at the very beginning (at position 0, as 0 is equivalent to false in PHP Read more…

Salesforce | Delete the Info/list of records permanently from Salesforce Recycle Bin

Author - Webner

You are not able to delete the records permanently and the records will be stored into the Recycle bin till 15 days from the deletion date:

Number of records stored in recycle bin = 5000* Number of Licenses your organisation has pursed.

If you want that all the records are deleted Read more…

‹ Prev page1 ... 34 35 36 37 38 39 40 41 42 43 44 ... 51 Next page ›