Posts

PHP array magic trick and manipulations

manipulating multidimensional array using array_map /** * Ilterate multidimensional array simplicity * @desc modify and manipulate or populate multidimensional array with simple tricks * @param array $arr * @param function $callback * @return Array **/ function Map($arr, $callback) { if (!is_callable($callback)) { throw new Exception("Callback must be function", 1); } return array_map(function ($key, $val) use ($callback) { return call_user_func($callback, $key, $val); }, array_keys($arr), $arr); }

VSCode

Install jQuery Auto Complete and Hinting on VSCode - Required  npm - Syntax Terminal npm i -- save @types / jquery

Project lists for beginner

Movies App (Flutter Project)

Android Studio Set Weight Layout Programatically

Image
LinearLayout.LayoutParams param = new LinearLayout.LayoutParams( LayoutParams.MATCH_PARENT, //OR WRAP_CONTENT -> layout_width LayoutParams.MATCH_PARENT, //OR WRAP_CONTENT -> layout_height 1.0f // layout_weight 1 ); YOUR_VIEW.setLayoutParams(param);

Git CLI Delete History Commit

Image
Checkout git checkout --orphan latest_branch Add all the files git add -A Commit the changes git commit -am "commit message" Delete the branch git branch -D master Rename the current branch to master git branch -m master Finally, force update your repository git push -f origin master

Build Gradle Component Definitions

Image
Common Gradle Command Prompt Command Description ./gradlew build build project, runs both the assemble and check task ./gradlew clean build build project complete from scratch ./gradlew clean build build project complete from scratch ./gradlew test

Increase Performance Android Studio

Image
Solver 1 You can speed up your Eclipse or Android Studio work, you just follow these: Open your single project clean your project after running your app in emulator every time use mobile/external device instead of emulator don't close emulator after using once, use same emulator for running app each time Disable VCS by using File->Settings->Plugins and disable the following things : CVS Integration Git Integration (Git & Github) Google Cloud Tools for Android Studio Subversion Integration Firebase (Optional) I am also using Android Studio with 4-GB installed main memory but following these statements really boost my Android Studio performance. Solver 2 Android Studio (up to 1.5GB) The IDE's JVM is configured to have a max heap size. You can see this in the lower-right corner of the main interface: