<!-- (A) LOAD CRYPTO JS LIBRARY --> <!-- https://cryptojs.gitbook.io/docs/ --> <!-- https://cdnjs.com/libraries/crypto-js --> <script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.0.0/crypto-js.min.js"></script> <script> // (B) ENCRYPT & DECRYPT FUNCTIONS var crypt = { // (B1) THE SECRET KEY secret : "CIPHERKEY", // (B2) ENCRYPT encrypt : function (clear) { var cipher = CryptoJS.AES.encrypt(clear, crypt.secret); cipher = cipher.toString(); return cipher; }, // (B3) … Continue reading BASIC JAVASCRIPT CRYPTO
Show progress-bar while loading using ajax
Download gif progess bar => http://www.ajaxload.info/ $(function() { $("#client").on("change", function() { var clientid=$("#client").val(); $('#loadingmessage').show(); $.ajax({ type:"post", url:"clientnetworkpricelist/yourfile.php", data:"title="+clientid, success:function(data){ $('#loadingmessage').hide(); $("#result").html(data); } }); }); }); On html body <div id='loadingmessage' style='display:none'> <img src='img/ajax-loader.gif'/> </div>
How to refresh .gitignore when making changes to .gitignore file
Here are just some points to note when making changes to the .gitgnore file to ensure Git is always tracking the right files. Make changes in .gitignore file.Run git rm -r --cached . command.Run git add . commandgit commit -m "Commit message" or just git commit or continue working. What is really important here is step 2. And remember to just run git add . command before doing any … Continue reading How to refresh .gitignore when making changes to .gitignore file
Allow Numeric with decimal and without decimal
Setup Laravel project after cloning
run composer install to generate depedencies in vendor folderchange .env.example to .envrun php artisan key:generateconfigure .env Windows Go to the project folderShift+Right Click -> Open command window here Mac Open Terminal, Type "cd " (with a space)From finder, Drag the project folderPress Enter to go inside the project folder Compose composer install Generate Key php artisan key:generate Setup Database Open the file .env(Assuming … Continue reading Setup Laravel project after cloning
How to Install PHP 7.2 on Ubuntu 16.04
Pre-flight: Check the Server Environment Correct Permissions: First, make sure you have proper root or sudo permissions to be able to manage the system and applications on the server. If you only have access to a non-root user on the system, then you may have to get more permissions from the server admin.Existing PHP Versions: Check for an existing … Continue reading How to Install PHP 7.2 on Ubuntu 16.04
Reading from WebSockets Python
WebSockets is a next-generation bidirectional communication technology for web applications which operates over a single socket and is exposed via a JavaScript interface in HTML 5 compliant browsers. Once you get a Web Socket connection with the web server, you can send data from browser to server by calling a send() method, and receive data from server … Continue reading Reading from WebSockets Python
SET DEFAULT BRIGHTNESS ON UBUNTU
The easiest way I found to set my brightness was to use the xbacklight package: sudo apt-get install xbacklight Now you can set the brightness easily to a certain percentage via the command line: xbacklight -set 50 To set the brightness automatically when I log in I use “Startup Applications” like so: Hit the super key and … Continue reading SET DEFAULT BRIGHTNESS ON UBUNTU
remove index.php from URL in CodeIgniter
How to remove index.php? 1. Create a .htaccess file Firstly we will need to create a .htaccess file in our project’s root directory or CodeIgniter directory. Creating a .htaccess file will allow us to modify our rewrite rules without accessing server configuration files. Because of this reason, .htaccess is critical to our web application’s security … Continue reading remove index.php from URL in CodeIgniter
MySQL Backup and Restore Commands for Database
A simple and easy method for creating MySQL backups is to use the mysqldump command. This command will create a simple .sql file of an existing database, which can then be restored to any other empty MySQL database. This article will work for any Linux distribution running MySQL. 1. Back up the database using the … Continue reading MySQL Backup and Restore Commands for Database
