Posts

Linux: Copy data from source to destination

Image
  Linux: Copy data from source to destination Example cp -a /var/www/html/source/. /var/www/html/destination/

Count down timer - Javascript

Image
HTML    < div   class = "counter_outer" >                      < ul >                          < li >                              < ul >                                  < li >< span   class = "daysNumber" > 00 </ span ></ li >                               ...

Install Node.js in Azamon Linux 2

Image
  Just run the below code in the command Here setup_8.x is your version. You can change your desired version. Example:  setup_8.x,  setup_12.x,  setup_14.x, etc curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash - sudo yum -y install nodejs

Encrypt Dycrypt in php

Image
  PHP Code Now you can make your own PHP encryption-decryption function using PHP Function:      function   my_crypt (  $string ,  $action  =  'e'  ) {           $secret_key  =  'make ur own key' ;           $secret_iv  =  'make your own iv' ;           $output  =  false ;       $encrypt_method  =  "AES-256-CBC" ;       $key  =  hash (  'sha256' ,  $secret_key  );       $iv  =  substr (  hash (  'sha256' ,  $secret_iv  ),  0 ,  16  );       if (  $action  ==  'e'  ) {           $output  =  base64_encode (  open...

Wordpress: Change profile picture wihout plugin and gravatar

Image
Step 1: go to wp-content/themes/yourtheme/functions.php write:           add_filter (  'get_avatar' ,  'ChangeAdminProfileIfNot' ,  10 ,  5  );          function   ChangeAdminProfileIfNot (  $avatar  =  '' ,  $id_or_email ,  $size  =  96 ,  $default  =  '' ,  $alt  =  ''  ) {              if (  "user_has_uploaded_a_local_avatar" ) {                               $avatar  =  "<img src='your image path' class='avatar avatar-{ $size } photo' height='{ $size }' width='{ $size }'" ;             ...

Google captcha validation with server side

Image
Create Captcha Credential here HTML:         < form   id = "registration"   name = "registration"   action = "#"   method = "POST" >          < input   type = "text"   name = "name"   placeholder = "Name"   />          < input   type = "email"   name = "email"   placeholder = "Email"   />          < input   type = "number"   name = "number"   placeholder = "Mobile Number"   />          < input   type = "password"   name = "password"   placeholder = "Password"   />          < div   class = "form-group" >              < div  ...

Print particular section in Javascript

Image
function   printDiv ( divName ) {   var   date  =  divName . parentElement . parentElement . querySelectorAll ( "td" )[ 0 ]. innerHTML ;   var   senderNameNumber  =  divName . parentElement . parentElement . querySelectorAll ( "td" )[ 1 ]. innerHTML ;   var   accountNumber  =  divName . parentElement . parentElement . querySelectorAll ( "td" )[ 2 ]. innerHTML ;   var   AccountHolderName  =  divName . parentElement . parentElement . querySelectorAll ( "td" )[ 3 ]. innerHTML ;   var   Amount  =  divName . parentElement . parentElement . querySelectorAll ( "td" )[ 4 ]. innerHTML ;   var   Tax  =  divName . parentElement . parentElement . querySelectorAll ( "td" )[ 5 ]. innerHTML ;   var   status  =  divName . parentElement . parentElement . querySelectorAll ( "td" )[ 6 ]. innerText ;   var   data  =...

Add dot dot after 3 line using css

Image
< div   class = "text" >     Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam consectetur venenatis blandit. Praesent vehicula,     libero non pretium vulputate, lacus arcu facilisis lectus, sed feugiat tellus nulla eu dolor. Nulla porta bibendum     lectus quis euismod. Aliquam volutpat ultricies porttitor. Cras risus nisi, accumsan vel cursus ut, sollicitudin     vitae dolor. Fusce scelerisque eleifend lectus in bibendum. Suspendisse lacinia egestas felis a volutpat. </ div >      .text  {          overflow...

Window is not defined error in node.js

Image
         const   app  =  express ();          const   PORT  =  process . env . PORT  ||  4000 ;          const   DIST_FOLDER  =  join ( process . cwd (),  'dist/browser' );          const   domino  =  require ( 'domino' );          const   fs  =  require ( 'fs' );          const   path  =  require ( 'path' );          const   template  =  fs . readFileSync ( 'dist/browser/index.html' ). toString ();          const   win  =  domino . createWindow ( template );          globa...