Set terminal title in Ubuntu 16

Create a function in ~/.bashrc:

function set-title() {
if [[ -z “$ORIG” ]]; then
ORIG=$PS1
fi
TITLE=”\[\e]2;$*\a\]”
PS1=${ORIG}${TITLE}
}

Use below command to set the terminal title.

set-title name

Example :

  1. set-title Gurudath
  2. set-title Gurudath Workplace

Reference link: https://askubuntu.com/questions/774532/how-to-change-terminal-title-in-ubuntu-16-04

Binary patched by using various algorithm :

bsdiff:

To install : sudo apt-get install bsdiff
Create Patch : bsdiff old_version_file new_version_file delta_file.bsdiff
Apply Patch : bspatch old_version_fil newfile delta_file.bsdiff
Example by using text file :
bsdiff dog.txt hen.txt hd.diff
bspatch hen.txt dog1.txt hd.diff

xdelta:

To install : sudo apt-get install xdelta3
Create Patch : xdelta3 -9 -S lzma -e -f -s old_version_file new_version_file xdelta_file
Apply Patch : xdelta3 -dfs old_version_file xdelta_file newfile
Example by using text file :
xdelta3 -9 -S lzma -e -f -s dog.txt hen.txt hd.delta
xdelta3 -dfs dog.txt hd.delta dog.txt

How to verify the content after patch using kdiff3:
hexdump old_version_file > myfile1.hex
hexdump new_version_file delta > myfile2.hex
kdiff3 myfile1.hex myfile2.hex : Here we can see the difference
hexdump newfile > myfile3.hex
kdiff3 myfile2.hex myfile2.hex : Here we can see no difference

 

Note: Tried using Ubuntu OS.

jQuery by Gurudath BN

jQuery Introduction

jQuery is a lightweight, “write less, do more”, JavaScript library.

The purpose of jQuery is to make it much easier to use JavaScript on your website.

jQuery also simplifies a lot of the complicated things from JavaScript, like AJAX calls and DOM manipulation.

The jQuery library contains the following features:

  1. HTML/DOM manipulation  
  2. CSS manipulation  
  3. HTML event methods  
  4. Effects and animations  
  5. AJAX  
  6. Utilities


The jQuery library is a single JavaScript file, and you reference to it using the HTML

<head>http://jquery.js</head>

There are two versions of jQuery available for downloading:  

  1. Production version : ­ This is for your live website because it has been minified and compressed .
  1. Development version :  This is for testing and development (uncompressed and readable code) .

Video link :- https://youtu.be/0FBRtM_azq0

Next post  will be soon. 

 

Animations using jQuery

animation-jquery-css
animation-jquery-css

The jQuery animate() method is used to create custom animations.

Syntax:

$(selector).animate({params},speed,callback);

params :- defines the CSS properties to be animated.
speed :- specifies the duration of the effect. It can take the following values: “slow”, “fast”, or milliseconds.
callback :- function to be executed after the animation completes.

animation Jquery

Example:

$(“button”).click(function(){
     $(“span”).animate({
        left: ‘250px’,
       opacity: ‘0.5’
    });
});

Using Relative Values

It is also possible to define relative values (the value is then relative to the element’s current value). This is done by putting += or -= in front of the value :

$(“button”).click(function(){
     $(“span”).animate({
        left: ‘250px’,
        height: ‘+=150px’
     });
});

Uses Queue Functionality

jQuery comes with queue functionality for animations.Which means that multiple animate() calls after each other, jQuery creates an “internal” queue with these method calls. Then it runs the animate calls ONE by ONE.

So, if you want to perform different animations after each other, we take advantage of the queue functionality:

$(“button”).click(function(){
       var span = $(“span”);
       span.animate({height: ‘300px’, opacity: ‘0.4’}, “slow”);
       span.animate({width: ‘300px’, opacity: ‘0.8’}, “slow”);
       span.animate({height: ‘100px’, opacity: ‘0.4’}, “slow”);
       span.animate({width: ‘100px’, opacity: ‘0.8’}, “slow”);
});

A sample example of using jQuery animation:

http://animation-jquery-css.bitballoon.com/

Jquery highlight search text plugin Gsearch on the webpage in a easy way.

hightlight search text jquery

Tiny, fast jQuery plugin to search text through elements as you type. This plugin is created and maintained by Gurudath BN ( Github ).

Features :-

  1. Lightweight. This plugin is only ~3.8kB minified and gzipped!
  2. Fast. This plugin is optimized for fast, lagless searching even through large element sets.
  3. Search types. This plugin provides search text ! Fuzzy matching, case insensitive also.
  4. Custom show/hide. You can define custom functions for showing and hiding the elements while searching.
  5. Provide a icon on hover textfield appear to search text , so it wont occupy space on page.
  6. Search anything. This plugin isn’t restricted to use on tables, any set of elements that has ‘rows’ with ‘columns’ inside them can be used.

Demo :-

Click here to view a demo of this plugin in action

https://jsfiddle.net/gurudath/k197zu3a/7/

Getting started :-

Basic usage  :-
U can know the basic workflow using the github url:-  https://github.com/gurudath/Gsearch

Git Path :- https://github.com/gurudath/Gsearch.git

Example usage :-

This example uses the configurations shown above to customize the plugin:

$(document).ready(function () {

       $(‘#update_stiky_search’).GSearch({

            update_at: ‘update_stiky_search’,

            margin_top: ‘100px’,

            background_color: ‘#01A9DB’,

            highlight_class: ‘highlight’,

            content_main: $(‘.main-content’)

        });

});