Posts

Showing posts from June, 2024

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

Laravel : Installation

-  To Install laravel globally so that whenever we want to create a new project no need to download it again. $ composer global require laravel/installer $ laravel new example-app - To Be Continue...

Xcode : deny(1) - file-write-data

  Update the Sandboxing Option: Navigate to Targets -> Project -> Build Settings -> Choose (All and Combined) -> User Script Sandboxing. Change the option from "Yes" to "No". OR  Search 'ENABLE_USER_SCRIPT_SANDBOXING'

Ionic : Live Reload

Image
  Open Xcode On menu Xcode > Open Developer Tool > Simulator Open terminal (on project) Run ionic cap run ios -l --external

Xcode : DT_TOOLCHAIN_DIR

  In Xcode 15 Apple changed the variable which points to the default toolchain location to $TOOLCHAIN_DIR from $DT_TOOLCHAIN_DIR. If some project/target used $DT_TOOLCHAIN_DIR then it need to be replace by $TOOLCHAIN_DIR. brew command brew upgrade cocoapods without brew sudo gem install cocoapods