Posts

Tips testing local untuk programmer 📌

" Go Extra Miles "  1. Faham Task Sebelum Mula Baca title, description, due date, dan duration . Faham sepenuhnya sebelum coding. Nilai kemampuan sendiri – jangan terlalu yakin atau ego. 2. Kalau Tak Mampu Capai Target Update duration awal , explain reason dengan jelas. Jika stuck, jumpa senior – mereka boleh bantu pecah task atau beri direction. 3. Gunakan Tools untuk Bantu Development Study dulu sebelum mula. Guna AI atau rujukan lain untuk speed up research dan development. 4. Testing Is King – Jangan Skip Testing bukan buang masa. Testing = Quality. Level 1 : Lepas siap code → test sendiri . Check fungsi tu digunakan kat mana-mana lagi – test semua related area. Ada ubah apa-apa → ulang step sama . Level 2 : Baca semula code sebelum push . Pastikan tiada benda pelik. Level 3 : Dalam GitLab, buat code review sendiri sebelum merge. Level 4 : Bila dah merge ke dev, test semula semua scenario . Ada issue → start test balik dari mula. Kalau kecil, pastikan betul-betul keci...

Create Slack application

 WHATSSUPPPPPPPP GUYS! ✅ Step 1: Create a Slack Incoming Webhook Go to: https://api.slack.com/apps Create a new app or select an existing one. This part kene manage  Go to "Incoming Webhooks" on the left menu. Activate Incoming Webhooks . Click "Add New Webhook to Workspace" and choose the #pg-alert channel or any channel that you want. Copy the generated Webhook URL (e.g., https://hooks.slack.com/services/XXXXXXXXX/XXXXXXXXX/XXXXXXXXXXXXXXXXXXXX ). ✅ Step 2: Create a Helper or Function in CodeIgniter You can place this in a helper ( application/helpers/slack_helper.php ) or directly in a model/controller. // application/helpers/slack_helper.php if (!function_exists('send_slack_alert')) {     function send_slack_alert($message)     {         $webhook_url = 'https://hooks.slack.com/services/XXXXXXXXX/XXXXXXXXX/XXXXXXXXXXXXXXXXXXXX'; // replace with your URL         $payload = json_encode([  ...

Leadership for beginner

Handling underlings Being a leader is not a job but a responsibility. Underperformance Think what the root cause of the team's downfall Negative attitude Not being honest, for example, asking a friend to record your attendance This behavior can lead the person to do it repeatedly even if they are not working. Measure issue How do we measure the problem? Objective KPI Subjective Evaluate How to handle Communication Confront Some people must confront when someone always does the same thing repeatedly. Before you confront you must take action, for example, invite them for a drink, that way you can resolve the issue of that person. Slow talk We must understand the person we want to talk to, each person doesn't have the same attitude, some can soft some is hard. Their personalities are different, try to learn it. Sometimes not about underlings, your boss is also can be included. Second person When we try to communicate or ask them, they may feel uncomfortable, now is the time we nee...

Get list of controller in Codeigniter

 Example code to retrieve controller name     public function spout_nonsense() { $string = shell_exec("ls application/controllers | paste -sd ',' -"); $controller_list = explode(',', $string); echo '<html><head></head><body><table><tbody>'; foreach ($controller_list as $file_name) { echo '<tr><td>'.str_replace('.php', '', $file_name).'</td></tr>'; } echo '</tbody></table></body></html>'; } 1. In order to retrieve all controller name, you can make a function that can construct list 2. The code given is for generate through server terminal. - Credit : Firdaus Safari (firdausbsafari.blogspot.com)

MAMP : Custom local domain

Open httpd.conf Scroll to end of file paste the code below <VirtualHost *:80>     ServerName localhost     DocumentRoot "/Applications/MAMP/htdocs"     <Directory "/Applications/MAMP/htdocs">         Options Indexes FollowSymLinks         AllowOverride All         Require all granted     </Directory> </VirtualHost> <VirtualHost *:80>     ServerName app.happyhive.local     DocumentRoot "/Applications/MAMP/htdocs/smap"     <Directory "/Applications/MAMP/htdocs/smap">         Options Indexes FollowSymLinks         AllowOverride All         Require all granted    ...

API: Basic 101

How it work A. Request B. Receive C. Response Ada client and server side Client : Our mobile, Web Server : Response Usually return as JSON : Because of light weight and standardize HTTP Methods A. GET B. POST C. PUT : Update, but usually use for upload File D. PATCH : Update few or part of resource E. DELETE Headers : Store all metadata including authenticate key Metdadata : Is some information about the Application, for example info about image Authentication A. Basic Auth : Login Auth B. API Token : Login Page C. API Key : Api to Api D. Oauth 2.0 : Authentication and Authorization Command line to serve in other port $ php artisan serve --port { Port Number }

PHP : Version

  For Homebrew user can run  brew install shivammathur/php/php@8.2 Open terminal  $ vim ~/.zshrc When the file open, press I on keyboard to insert, and then put the new path. After that, to save it press Esc and :WQ . On the file, also can change the php version. After it exit the file run this command to refresh the file (To make sure it save). $ source ~/.zshrc