Skip to main content

Posts

Showing posts with the label my notes

MVC vs HMVC vs HAVC

MVC (Model-View-Controller) The most-common, traditional approach where files are grouped by type . CodeIgniter 3 uses MVC. Characteristics: Centralized folders for all Controllers, Models, and Views. Best For: Small to medium-sized projects. Pros: Very simple to set up. You literally can't mess this up. Cons: Might become serabut as the project grows. Still usable though. Directory Example: HMVC (Hierarchical Model-View-Controller) An evolution of MVC. Further organizes files into modules . Characteristics: Each feature has its own folder containing its own MVC structure. Best For: Medium to large-scale projects. Pros: Much cleaner folder structure. Can easily be moved or reused in other projects. HAVC (Hierarchical Asset-View-Controller) A specialized variation of HMVC, popularized by the Trongate framework. Characteristics: Replaces the "Model" folder with an " Asset " folder. Structure: Everything specific to a module, including models, CSS, Java...

How to get solution when you’re stuck

  How to get solution when you’re stuck ask people when? people is available. always ask your tablemate first.   first question should always be ‘nak tanya boleh tak?’ if you’re stuck for more than 30mins, try to ask even when people are busy. simple (yes or no answer/where is this?) specific to the environment (ask about smap/urusbisnes) no data online (explain about one_model, one_helper) how? provide context - what task you are doing, what error you got, who you dont like in the office show proof of your findings/solution search online when? people visibly busy answer available online. eg: issues with CI3/PHP/MySQL how? copy paste the entire error message (not the whole text, just the message). usually this works for old systems like CI3 where there are lots of forums discussing the errors search based on keywords. y say many when few do tricks? eg: ’ios notch in app browser issue’ add forum names at the and of search text. eg: ios notch in app browser issue reddit/stackove...

Perbezaan Product / Project / Customization / Whitelabel

Perbezaan Product / Project / Customization / Whitelabel Product - Kita sendiri hasilkan. Kita jual pada customer. Subscription based payment untuk guna product. Project - Customer minta kita buat sistem. Customer nk guna, atau customer nk jual pada orang lain. Payment one-off atau beberapa payment. Customization - Kita customize product kita untuk certain customer. Guna repository & server sama as normal product, cuma ada checking, kalau organization tu ada customization, dia akan keluar menu/feature baru. Whitelabel - Product sedia ada, kita jual kepada customer untuk kegunaan organization diorang. Whitelabel guna repository sama dengan product. Tapi ada server sendiri, asing dengan product.   Example:   product - app.smap.my   whitelabel - ppa.smap.my

PHP Short Code

ternary vs coalescing null operator checks for null values example: echo isset($item_name) ? $item_name : NULL; echo $item_name ?? NULL; ternary vs elvis operator (ternary shorthand) checks for truthy values example: echo !empty($item_name) ? $item_name : NULL; echo $item_name ?: NULL; using ternary vs (coalescing null operator & elvis operator) example: echo isset($item_name) && !empty($item_name) ? $item_name : ‘default’; echo $item_name ?? $item_name ?: ‘default’; spaceship operator used to compare 2 values and returns either -1,0,1. mostly used to compare dates example: var_dump(1 <=> 2); // returns int(-1) var_dump(1 <=> 1); // returns int(0) var_dump(2 <=> 1); // returns int(1)

Test Guideline

  Test Guideline understand the requirement fahamkan title, desc & requirement task take note access utk user test lebih dari 1 organisasi try masuk sanitised live account utk test listkan main point utk di test create a test plan take note possible scenario try buat flow dari awal ikut flow yg legit cari page lain yg mungkin affected, contoh: satu view mungkin diguna untuk beberapa function perform testing functional testing - test function & mencapai goal atau tak non functional testing - ux, performance, security, usability test result focus on one test, takut lupa. then proceed with next one Conclusion: Test sehabis baik, try untuk cari bug sebelum sampai ke tester/production. 

Other useful things I sometime use but always forgot

  🐘 Useful PHP functions One line year array // will get the past 3 year including current year. eg: 2021,2022,2023 for ($i=-2; $i <= 0 ; $i++) $data['year'][date('Y')+$i] = date('Y')+$i; Unset attribute in array of array object $body_list[$count] = array(             'attr' => array(                 '1' => 'one',                 '2' => 'two',             ),             'data' => (object) array(                 '3' => 'three',                 '4' => 'four',             )         ); unset($body_list[$count]['data’]->{‘3’}); // will remove attribute ‘three’ Merge/combine array with duplicate keys while preserving the values // use this inside loops where + won...