Skip to main content

Posts

React Js Commands

React JS Commands and Useful purposes  To Install react app: npx create-react-app app-name To Install react app: npx create-react-app . To check npm version: npm --version Inside that directory, you can run several commands:   npm start     Starts the development server.   npm run build     Bundles the app into static files for production.   npm test     Starts the test runner.   npm run eject     Removes this tool and copies build dependencies, configuration files     and scripts into the app directory. If you do this, you can’t go back! node -v (To check node version)

Reactjs jsx

ReactJS JSX   React is a modular, scalable, flexible, and popular front-end framework. What is JSX? JSX is a syntax extension for JavaScript. It was written to be used with React. JSX code looks a lot like HTML. What does “syntax extension” mean? In this case, it means that JSX is not valid JavaScript. Web browsers can’t read it! If a JavaScript file contains JSX code, then that file will have to be compiled. This means that before the file reaches a web browser, a JSX compiler will translate any JSX into regular JavaScript. Codecademy’s servers already have a JSX compiler installed, so you don’t have to worry about that for now. Eventually we’ll walk through how to set up a JSX compiler on your personal computer. JSX is a syntax extension for JavaScript which allows us to treat HTML as expressions. const h1 = <h1>Hello world</h1>; They can be stored in variables, objects, arrays, and more! Here’s an example of several JSX elements being stored in an object: const myTeam =

Mysql columns creation in laravel

List of columns  $table->id(); // increment value $table->string('title')->comment('this is blog title'); $table->string('slug')->unique(); $table->text('short_desc'); $table->longText('description'); $table->boolean('is_published')->default(false); $table->integer('min_of_read')->nullable(true); $table->enum('status', ['Active', 'Inactive']); $table->float('discount'); $table->smallInteger('type_id'); $table->date('start_date')->nullable(); $table->timestamps(); $table->foreign('created_by')->references('id')->on('users'); // introducing foreign key $table->unsignedBigInteger('user_id'); //? $table->decimal('latitude', 9, 6)->nullable(true); // Let's say you want starting value from 1000 $table->id()->from(1000); // increment value start from 1000 ->nullabl

Vue Js (Basics 2)

Vue Data Data Now that our Vue app is hooked up to our HTML, we are ready to generate and display dynamic data. As discussed in Introduction to Vue, displaying and updating dynamic data for users is essential functionality for most front-ends. Most values on the web can change at any moment, such as the number of likes on a post or the current set of posts to display. We call constantly-changing data values like this dynamic data . We need a place to store dynamic data values so that we can still use them in our HTML even when we don’t know what their values will be at any given moment. There are many different ways to do this in Vue. The simplest way is the data property on the options object. The value of data is an object. Each key-value pair in this object corresponds to a piece of data to be displayed in the template. The key is the name of the data to use in the template and the value is the value to display when the template is rendered. We then use mustache sy

Vue JS (basics 1)

  INTRODUCTION TO VUE Creating Vue Apps Our project now has access to the Vue library. This gives us access to all of the code that will allow us to make Vue apps, web front-ends built using Vue, but doesn’t actually create one for us. We now need to write the code to actually make a Vue app. Vue makes it easy to make a new app by exporting a class called  Vue . Much like any other JavaScript class, we create instances of this class using the  new  keyword. Each of these  Vue  instances is a fully-functioning Vue app. Let’s look at an example: // app.js const app =  new Vue ({}); By invoking the  Vue  class constructor with the  new  keyword, we create a new instance of the  Vue  class which we name  app . The  Vue  constructor can set many properties on our Vue app when it is called. However, unlike many constructors, the  Vue  class does not take each of these properties as separate arguments. Rather, it only takes one argument. Vue apps require a lot of information — information t

AngularJs notes

 Two Requirements Add <script> tag pointing to angular.js Add an ng-app attribute in your HTML ng-app is an angular directive the ng is short for Angular <div ng-app> this is an example </div> To simple check that is angular js running or not, simple use {{ 4 * 4 }} in a plain html  <div ng-app> this is an example {{ 4 * 4 }} </div> siddhu

PHP encrypt and decrypt

 <?php $string_to_encrypt="Test"; $password="password"; $encrypted_string=openssl_encrypt($string_to_encrypt,"AES-128-ECB",$password); $decrypted_string=openssl_decrypt($encrypted_string,"AES-128-ECB",$password); echo $encrypted_string; echo "\n.............\n"; echo $decrypted_string; $data = [    ]; echo "<br/>"; $password = "siddhu**7**0"; foreach($data as $d) { echo $d."\n"; echo "<br/>"; echo openssl_decrypt($d,"AES-128-ECB",$password); echo "<br/>"; echo "<br/>"; } ?>