I recently got this error whenever I install vue in laravel using the following commands: I get this new error and its the first time that happened to me: and I tried to make a new laravel project and didn’t work. Solution : First run : npm i vue-loader After that run : npm run… Continue reading problem with installing Laravel 8 and vue.js Error: Cannot find module
5 JavaScript Loops that you want to know about
1. For 2. While 3. Do While 4. For Of5. For In BONUS: 1. ForEach 2. For as a While 1. For Loop This is the most well known Loop and I don’t recall any programming language without it. It has : 1. Counter Initialization 2. Stop condition 3. Step on every iteration 2. While… Continue reading 5 JavaScript Loops that you want to know about
5 platforms to boost your coding skills with online tests and challenges
1. HackerRank HackerRank is a place where programmers from all over the world come together to solve programming problems. It provides verified solutions you can check at any time and a wide array of programming/coding questions for you to solve.https://www.hackerrank.com 2. Exercism IO Exercism is a free platform which aims to provide opportunity for people… Continue reading 5 platforms to boost your coding skills with online tests and challenges
7 online [GUI] tools that will make your CSS coding easier
I bring to you 7 online tools with which you can automate CSS and save yourself some time and hassles. Make sure you read till the end cuz number 6 and 7 are the most powerful. 1. SmolCSS A collection of readymade CSS grid samples you can grab from codepen. Link: http://SmolCSS.dev 2. PxtoEm Convert… Continue reading 7 online [GUI] tools that will make your CSS coding easier
Yii2 . FORM How to make dependant drop down. Where second drop downs values are dependant on first drop down selection
In form file : 1 2 3 4 5 6 7 8 9101112131415161718 <?= $form->field($model, ‘country_id’)->dropDownList([“5″=>’USA’, “6”=>”Pakistan”], [‘prompt’=>’Select Country’, ‘onchange’=>’ $.get( “‘.yiihelpersUrl::toRoute(‘/site/getstates’).'”, { id: $(this).val() } ) .done(function( data ) { $( “#’.Html::getInputId($model, ‘state_id’).'” ).html( data ); } ); ‘,’class’ => ‘form-control’ ] ); ?> <?= $form->field($model, ‘state_id’) ->dropDownList( [ ‘prompt’=>’Select State’, ] ); ?>… Continue reading Yii2 . FORM How to make dependant drop down. Where second drop downs values are dependant on first drop down selection
yii2 get username of logged in user
Use following code get the username of the currently logged in user : <?= Yii::$app->user->identity->username ?>
Java , convert a String to an int
To convert a string to an in int in java we use Integer.parseInt() function.Example: String anyNumber = “15”;int result = Integer.parseInt(anyNumber); System.out.println(result); int aaa = Integer.parseInt(“123456”); See the Java Documentation for more information. (If you have it in a StringBuilder (or the ancient StringBuffer), you’ll need to do Integer.parseInt(myBuilderOrBuffer.toString()); instead). A very important point to consider is that the Integer parser throws NumberFormatException as stated… Continue reading Java , convert a String to an int
How to undo last commtis on GIT
If you have comitted wrong files to git and you want to undo it, here is what you can do : $ git commit -m “Some comment here” (1)$ git reset HEAD~ (2)<< edit files as necessary >> (3)$ git add … (4)$ git commit -c ORIG_HEAD (5) This is what you are looking to… Continue reading How to undo last commtis on GIT
Yii2: Using csrf token
Yii2: Using csrf token First, if you do not understand what is the CSRF token? and why should we use it, please refer to the following link :https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF) One of the new features of Yii2 is CSRF validation enabled by default.If you use ajax or basic form as follows : <form action=’#’ method=’POST’> ………..</form> You… Continue reading Yii2: Using csrf token
YII2 form generate _csrf for form manually
YII2 form generate _csrf for form manually <form action=’#’ method=’POST’> <input type=”hidden” name=”_csrf” value=”<?=Yii::$app->request->getCsrfToken()?>” /> ….</form>