Category Archives: Uncategorized

Basic git flow

Basic git flow

from remote “master”, create a branch “develop”.

pull branch “develop”

branch out branch “feature” or “bug” from local “develop”

commit changes to branch”feature”

push branch”feature” to remote branch”feature”

request merge to remote branch “develop”

after merged, pull branch “develop” to local

 

Billplz Notes

Billplz is a malaysian’s payment gateway. It’s free to register, easy to setup and affordable.

Register free here

If you are using postman to test, add the API Key as username in Authorization tab. Choose “Basic Auth” in Type dropdown. Then enter the URL and params as usual

 

Free tools for small businesses

Some free tools you can use to start your business. The providers normally provide the free tools for basic usage. Some limitation on features and users. But if you are small, it doesn’t matter much. At least you can start with some cool softwares to support your small business

CRM – hubspot

Support Ticket/ Help Desk – freshdesk

Accounting – waveapps – need to pay to use payroll and payments

Version control – GitLab

Multiple database in CodeIgniter

How to connect to more than one database in codeigniter

Database config

$db[‘default’][‘hostname’] = “localhost”;
$db[‘default’][‘username’] = “root”;
$db[‘default’][‘password’] = “”;
$db[‘default’][‘database’] = “database_name”;
$db[‘default’][‘dbdriver’] = “mysql”;

set another config for 2nd database

$db[‘otherdb’][‘hostname’] = “localhost”;
$db[‘otherdb’][‘username’] = “root”;
$db[‘otherdb’][‘password’] = “”;
$db[‘otherdb’][‘database’] = “other_database_name”;
$db[‘otherdb’][‘dbdriver’] = “mysql”;

Sample to call

//Load another database
$DB2 = $this->load->database(‘another_db’, TRUE);

//Default database query
$this->db->select(‘first_name, last_name’);
$this->db->from(‘users’);
$this->db->where(‘id’, 99);
$query = $this->db->get();

//Another database query
$DB2->select(‘image’);
$DB2->from(‘cdn_images’);
$DB2->where(‘id’, 25);
$query = $DB2->get();

 

References

codexworld.com/connect-use-multiple-database-codeigniter

 

Ionic notes

Installation

1. Install Node JS to be able to use npm (js package manager)

https://nodejs.org/en/download/

After install Node JS, npm can be used.

To verify the installation successful can use the following command

node --version
npm --version

2. Then install ionic CLI using npm

Note: Use root or admin access to install

npm install -g @ionic/cli

# if to remove previous installation, use following command #
# -g means to install globally #

npm uninstall -g ionic
npm install -g @ionic/cli

Start project

Create new project using following command line. Several questions will be asked to setup the project – e.g. which js framework to use, initial framework etc.

ionic start

Ionic structure

index.html – main template to control title, icon
tabs – to control tabs
tab1, tab2 etc – page content

To preview the end result in browser, in terminal, go to project directory and run following command

ionic serve

Default port is 8100. To view the result, can go to http://localhost:8100

To add new page. Ionic generate command can be used to generate some other things as well like service, directive etc.

ionic generate

or in short:

ionic g

Compile ionic project to ios files. Before can start compiling, must do some setup on Xcode

  1. install Xcode in mac
  2. Once Xcode is installed, make sure the command-line tools are selected for use
    type this in terminal – xcode-select — install
  3. Setup a development team
    1. xcode > preferences > accounts. Add an apple ID. Once logged in, personal team will appear in the team list
  4. Create iOS simulator
    1. open xcode. Navigate to Window > Devices and Simulators. Can choose any simulator available
  5. Install ios-sim and ios-deply as below

The ios-sim and ios-deploy are utilities that deploy apps to the iOS simulator and iOS devices during development. They can be installed globally with npm.

npm install -g ios-sim
brew install ios-deploy

Build files for ios

  1. Generate native project. run at terminal:
    1. ionic capacitor add ios
    2. ionic capacitor open ios
    3. ionic capacitor copy ios

Resources

  1. official ionic docs
  2. ionic ui components
  3. ionicons
  4. building first app with ionic angular
  5. steps to build for ios
  6. steps to build for android
  7. deploying mobile on android and ios

Notes on SSL

HTTPS becoming a standard now for all apps and websites.

Free SSL

  1. lets encrypt
  2. comodo (free 90 days)

To check for SSL status

https://www.sslshopper.com/ssl-checker.html?hostname=yourdomain.com

To enable SSL in cPanel

cPanel > SSL/TLS Status > Tick/Select Domain Name > Click Run AutoSSL

Looking for a used car

Getting yourself a used car has some advantages. The most severe one is you save thousands of your money. But need to be very careful in order to get a used car with good condition.

If you are looking for a used car, try out the following websites.

  1. mudah.my – huge list of cars available
  2. carlist.my – most of the list are more or less the same with mudah. especially from car dealer
  3. motortrader.com.my – there is a rating from Goo KANTEI for the condition of the car. For some cars. Can find more cars directly from owners
  4. oto.my – related to paultan.org and carbase.my

the rest not worth to mention here. Don’t have many listings

Some general tips to purchase second hand car

  1. if possible check why previous owner sell
  2. before go to see, ask questions over the phone. The most important one whether the car still available
  3. ask to see the grant
  4. ask for any other charges on top of car price – insurance, roadtax, change name, puspakom service, loan processing etc.

Some tips on checking the condition of the car

  1. sign of accident (normally with uneven paint)
  2. any leaking on engine and absorber etc
  3. the hose and belts are in acceptable condition
  4. test drive to check on engine is smooth and no irregular sounds from the car body or engine
  5. tyre tread still ok, manufactured not more than 3 years