October 19 2021

Windows 2008 R2 IIS7.5 SSL not working

Tagged Under : ,

It was because IIS on Windows Server 2008 R2 build in Transport Layer Security in version 1 (TLS 1.0). That version is outdated and should not be used for securing any HTTPS traffic and also most of the browser didn’t support it anymore at the beginning of 2020.

October 17 2020

CPanel automatically backup MySQL Database

Tagged Under : , ,

1. Login to your CPanel Account. 2. Find the Database you want to backup. 3. Get the Database MySQL Username and Password

April 16 2018

CSS and Jquery Android click Ripple effect look like

Tagged Under : , ,

css3
Below are showing example Android click Ripple effect with CSS3 and Jquery.
Below was 2 example:
Example 1
Example 2

April 16 2018

MySQL week() function not correct display

Tagged Under :

MySQL
I am try gather some statistics from a database and it need group by week numbers. and the results return unexpected.
SELECT create_date, WEEK(create_date) as week FROM `ttable` 
+---------------------+-------------+
| craete_date         | week        |
+---------------------+-------------+
| 2018-01-02 00:00:00 |           0 | 
| 2018-04-10 00:00:00 |          14 | 
| 2018-03-13 00:00:00 |          10 | 
| 2018-03-30 00:00:00 |          12 | 
+---------------------+-------------+
From the above you will found that the week number was wrong. and MySQL counts the first days of the year that do not belong week 1 as week 0.

This is because MySQL default week() function caused the issue. because in MySQL the first day of week is Sunday and it range was 0 to 53 weeks. And you need change the MySQL mode with the below table.

January 14 2018

IONIC 3 display config.xml version number on APP

Tagged Under :

ionic
To use config.xml version number on APP. you need install APP VERSION with npm.

To display the version number on APP.
this.platform.ready().then(() => {
	this.appVersion.getVersionNumber().then((value) => {
		var value = value.replace(/"/g, '');
		this.version = 'v'+value;
	})
});
and then put {{version}} where you want to display in html page.

and the output will be like this v1.0.1

January 14 2018

IONIC 3 dynamic loading control content or text

Tagged Under :

ionic
In IONIC 3 LoadingController you can set the content or text in starting. But if the loading is for getting information from many place and you want to display how many percent was completed or the process until which step.
this.loading = this.loadingCtrl.create({content: 'Please wait...'});

October 03 2017

Javascript display money format

Tagged Under :

javascript
Sometimes we need using javascript to display money format in our system but javascript don’t have this kind of function. So we need to write a function to convert number to money format.

October 02 2017

Javascript get compass direction with the two longitude and latitude

Tagged Under : ,

ionic
Just develop a project with IONIC and google map to tracking the transport routing. Because the google map wouldn’t rotate itself when the transport moving. It will confuse the user when they look at the map.

So I need to rotate the map to let navigation always facing to top. It will easy user to understand when they look at the map.

July 18 2017

Yii2 set wraptext on moonlandsoft phpexcel

On phpexcel you are allow to set “setWrapText(true)” property. but on Yii2 plugin moonlandsoft phpexcel it don’t have this property.

To set this property. you need to add extra code on the plugin.
Open Excel.php file. and then scroll to line 387 add the code below.
if (isset($column['wraptext']) &&  $column['wraptext'] == true) {
	$activeSheet->getStyle($col.$row)->getAlignment()->setWrapText(true);
}

March 26 2017

Jquery set focus on last character in input text box

Tagged Under :

javascript
Normally using Jquery or Javascript to set focus on input box it will point to beginning of the text box. But if you want it point to last character in input text box. you may need write a Jquery class to do.

Below is the Jquery function:
(function($){
    $.fn.focusTextToEnd = function(){
        this.focus();
        var $thisVal = this.val();
        this.val('').val($thisVal);
        return this;
    }
}(jQuery));

You may easy to use the function like below
$("#input").focusTextToEnd();