Animated Flying Twitter Bird Code

8 Oct

Animated Flying Twitter Bird Code :

<script src=”http://bloggerblogwidgets.googlecode.com/files/way2blogging.org-tripleflap.js&#8221; type=”text/javascript”></script>
<script type=”text/javascript”> var twitterAccount = “Your twitter account name”;tripleflapInit();</script>
<script src=”http://tweetmeme.com/i/scripts/button.js&#8221; type=”text/javascript”></script>

 

Note :

Replace “Your twitter account name” with your twitter user name.(ex:twitter.com/@abc)

Referred by :

http://123bestfriend.blogspot.in/2011/05/animated-flying-twitter-bird-flowers.html

Animated+Flying+Twitter+Bird+Gadget+For+Blogger-Royal-Tutor.png

Ubuntu Commands

4 Oct

Ubuntu Commands list :

Terminal : Ctrl + Alt + T

File & Directory Commands :

pwd:

The pwd command will allow you to know in which directory you’re located

ls:

The ls command will show you (‘list’) the files in your current directory.

cd:

The cd command will allow you to change directories.

cp:

The cp command will make a copy of a file for you.

mv:

The mv command will move a file to a different location or will rename a file.

rm:

Use this command to remove or delete a file in your directory.

rmdir:

The rmdir command will delete an empty directory.

mkdir:

The mkdir command will allow you to create directories.

man:

The man command is used to show you the manual of other commands.

sudo:

The sudo command is used to perform file operations on files that the Root User would only be allowed to change.

More Info : cd

To navigate into the root directory, use “cd /”

To navigate to your home directory, use “cd” or “cd ~”

To navigate up one directory level, use “cd ..”

To navigate to the previous directory (or back), use “cd -”

Running a File Within a Directory :

./filename.extension

System Information Commands :

df:

The df command displays filesystem disk space usage for all mounted partitions.

du:

The du command displays the disk usage for a directory.

free:

The free command displays the amount of free and used memory in the system.

top:

displays information on your Linux system, running processes and system resources.

uname -a:

prints all system information, including machine name, kernel name & version, and a few other details.

lsb_release -a :

The lsb_release command with the -a option prints version information for the Linux release you’re running.

1)Command privileges.

sudo command – run command as root
sudo su – root shell open
sudo su user – open shell as a user
sudo -k – forget your password sudo
gksudo command – sudo visual dialog (GNOME)
kdesudo command – sudo visual dialog (KDE)
sudo visudo – edit / etc / sudoers
gksudo nautilus – root file manager (GNOME)
kdesudo konqueror – root file manager (KDE)
passwd – change your password

2)Command Network

ifconfig – displays information network
iwconfig – displays information from wireless
sudo iwlist scan – scan wireless networks
sudo /etc/init.d/networking restart – reset the network
(file) /etc/network/interfaces – manual configuration
ifup interface – bring online interface
ifdown interface – disable interface

3)Commands Display

sudo /etc/init.d/gdm restart – reset X (Gnome)
sudo /etc/init.d/kdm restart – reset X (KDE)
(file) /etc/X11/xorg.conf – show Configuration
sudo dpkg-reconfigure – reconfigure xserver-xorg-phigh – reset configuration X
Ctrl+Alt+Bksp – X display reset if frozen
Ctrl+Alt+FN – switch to tty N
Ctrl+Alt+F7 – switch back to X display

4)Commands Service System.

start service – service to start work (Upstart)
stop service – service to stop working (Upstart)
status service – check if service is running (Upstart)
/etc/init.d/service start – start service (SysV)
/etc/init.d/service stop – stop service (SysV)
/etc/init.d/service status – check service (SysV)
/etc/init.d/service restart – reset service (SysV)
runlevel – get current runlevel

5)Commands for Firewall.

ufw enable – turn on the firewall
ufw disable – turn off the firewall
ufw default allow – allow all connections by default
ufw default deny – drop all connections by default
ufw status – current rules and
ufw allow port – to allow traffic on port
ufw deny port – port block
ufw deny from ip – ip block

6)Command System.

lsb_release -a – get the version of Ubuntu
uname -r – get kernel version
uname -a – get all the information kernel

7)Commands for Package Manager.

apt-get update – refresh updates available
apt-get upgrade – update all packages
apt-get dist-upgrade – version update
apt-get install pkg – installing pkg
apt-get remove pkg – uninstall pkg
apt-get autoremove – removing packages obsotletos
apt-get -f install – try to fix packages
dpkg –configure -a – try to fix a broken package
dpkg -i pkg.deb – install file pkg.deb
(file) /etc/apt/sources.list – list of repositories APT

8)Special Packages For commands.

ubuntu-desktop – Setting the standard Ubuntu
kubuntu-desktop – KDE Desktop
xubuntu-desktop – desktop XFCE
ubuntu-minimal – core earnings Ubuntu
ubuntu-standard – the standard utilities Ubuntu
ubuntu-restricted-extras – not free, but useful
kubuntu-restricted-extras – ditto KDE
xubuntu-restricted-extras – ditto XFCE
build-essential – packages used to compile
linux-image-generic – latest generic kernel image
linux-headers-generic – latest headlines

9)Applications commands.

nautilus – File Manager (GNOME)
dolphin – File Manager (KDE)
konqueror – Web browser (KDE)
kate – text editor (KDE)
gedit – text editor (GNOME)

Referred by :

1)ubuntu.com
https://help.ubuntu.com/community/UsingTheTerminal

2)Nikesh Jauhari
(http://linuxpoison.blogspot.in/2008/10/useful-commands-in-ubuntu.html)

Cross-Browser CSS Gradient

25 Sep

CSS CODE: Gradient

SUPPORT((Firefox,Internet Explorer,Chrome,Safari,Opera,Netscape Navigator)

background: #1e5799; /* Old browsers */

background: -moz-linear-gradient(top, #1e5799 0%, #2989d8 50%, #207cca 51%, #7db9e8 100%); /* FF3.6+ */

background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#1e5799), color-stop(50%,#2989d8), color-

stop(51%,#207cca), color-stop(100%,#7db9e8)); /* Chrome,Safari4+ */

background: -webkit-linear-gradient(top, #1e5799 0%,#2989d8 50%,#207cca 51%,#7db9e8 100%); /* Chrome10+,Safari5.1+ */

background: -o-linear-gradient(top, #1e5799 0%,#2989d8 50%,#207cca 51%,#7db9e8 100%); /* Opera 11.10+ */

background: -ms-linear-gradient(top, #1e5799 0%,#2989d8 50%,#207cca 51%,#7db9e8 100%); /* IE10+ */

background: linear-gradient(to bottom, #1e5799 0%,#2989d8 50%,#207cca 51%,#7db9e8 100%); /* W3C */

filter: progid:DXImageTransform.Microsoft.gradient( startColorstr=’#1e5799′, endColorstr=’#7db9e8′,GradientType=0 ); /* IE6-9
*/

Referred by :
OR
#Gradient_button{/* fallback */
background-color:#063053;/* chrome 2+, safari 4+; multiple color stops */
background-image:-webkit-gradient(linear,left bottom,left top,color-stop(0.32,#063053),color-stop(0.66,#395873), color-stop(0.83,#5c7c99));

/* chrome 10+, safari 5.1+ */
background-image:-webkit-linear-gradient(#063053,#395873,#5c7c99);

/* firefox; multiple color stops */
background-image:-moz-linear-gradient(top,#063053,#395873,#5c7c99);

/* ie 6+ */
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=’#063053′, endColorstr=’#395873′);

/* ie8 + */
-ms-filter: “progid:DXImageTransform.Microsoft.gradient(startColorstr=’#063053′, endColorstr=’#395873′)”;

/* ie10 */
background-image: -ms-linear-gradient(#063053,#395873,#5c7c99);

/* opera 11.1 */
background-image: -o-linear-gradient(#063053,#395873,#5c7c99);

/* The “standard” */
background-image: linear-gradient(#063053,#395873,#5c7c99);
}

jQuery Effects

25 Sep

jQuery Effects

1.jQuery Simple  Hide/Show

<script src=”jquery.js”></script>
<script>
$(document).ready(function(){
$(“#hide”).click(function(){
$(“p”).hide();
});
$(“#show”).click(function(){
$(“p”).show();
});
});
</script>

 

Full Example:

<!DOCTYPE html>
<html>
<head>
<script src=”jquery.js”></script>
<script>
$(document).ready(function(){
$(“#close”).click(function(){
$(“p”).hide();
});
$(“#open”).click(function(){
$(“p”).show();
});
});
</script>
</head>
<body>
<p>HI WELCOME</p>
<button id=”close”>Hide</button>
<button id=”open”>Show</button>
</body>
</html>

 

2.jQuery Fade :

1. fadeIn()

The jQuery fadeIn() method is used to fade in a hidden element.

<script src=”jquery.js”></script>
<script>
$(document).ready(function(){
$(“button”).click(function(){
$(“#div1”).fadeIn();
$(“#div2”).fadeIn(“slow”);
$(“#div3”).fadeIn(3000);
});
});
</script>

2.fadeOut()

The jQuery fadeOut() method is used to fade out a visible element.

<script src=”jquery.js”></script>
<script>
$(document).ready(function(){
$(“button”).click(function(){
$(“#div1”).fadeOut();
$(“#div2”).fadeOut(“slow”);
$(“#div3”).fadeOut(3000);
});
});
</script>

3.fadeToggle()

The jQuery fadeToggle() method toggles between the fadeIn() and fadeOut() methods.

<script src=”jquery.js”></script>
<script>
$(document).ready(function(){
$(“button”).click(function(){
$(“#div1”).fadeToggle();
$(“#div2”).fadeToggle(“slow”);
$(“#div3”).fadeToggle(3000);
});
});
</script>

4.fadeTo()

The jQuery fadeTo() method allows fading to a given opacity (value between 0 and 1).

<script src=”jquery.js”></script>
<script>
$(document).ready(function(){
$(“button”).click(function(){
$(“#div1”).fadeTo(“slow”,0.15);
$(“#div2”).fadeTo(“slow”,0.4);
$(“#div3”).fadeTo(“slow”,0.7);
});
});
</script>

Full Example:

<!DOCTYPE html>
<html>
<head>
<script src=”jquery.js”></script>
<script>
$(document).ready(function(){
$(“button”).click(function(){
$(“#div1”).fadeIn();
$(“#div2”).fadeIn(“slow”);
$(“#div3″).fadeIn(3000);
});
});
</script>
</head>

<body>
<p>fadeIn eg.</p>
<button>Click Here</button>
<br><br>
<div id=”div1″ style=”width:80px;height:80px;display:none;background-color:red;”></div><br>
<div id=”div2″ style=”width:80px;height:80px;display:none;background-color:green;”></div><br>
<div id=”div3″ style=”width:80px;height:80px;display:none;background-color:blue;”></div>

</body>
</html>

Referred by :

http://www.w3schools.com/jquery/

 

 

About jQuery

25 Sep

jQuery questions

 

What is jQuery?

jQuery is a lightweight JavaScript library that emphasizes interaction between JavaScript and HTML.
jQuery is a JavaScript Library.
jQuery greatly simplifies JavaScript programming.

Advantages of jQuery :

Ease of use
Large library
Ajax support
Great documentation and tutorials
Strong opensource community. (Several jQuery plugins available)
JavaScript enhancement without the overhead of learning new syntax
Ability to keep the code simple, clear, readable and reusable

jQuery Syntax

$(selector).action()

A $ sign to define/access jQuery
A (selector) to “query (or find)” HTML elements
A jQuery action() to be performed on the element(s)

Examples:

$(this).hide() – hides the current element.
$(“p”).hide() – hides all <p> elements.

Questions:

1.Is jQuery a library for client scripting or server scripting?
Ans: Client scripting

2.Is jQuery a W3C standard?
Ans: No

(Note:W3C standards define an Open Web Platform for application development that has the unprecedented potential to enable developers to build rich interactive experiences, powered by vast data stores, that are available on any device.)

3.What are jQuery Selectors?
Ans: Selectors are used in jQuery to find out DOM elements. Selectors can find the elements via ID, CSS, Element name and hierarchical position of the element.

4.The jQuery html() method works for both HTML and XML documents?
Ans: It only works for HTML.

5.What is the difference between HTML and XML?

XML was designed to describe data and to focus on what data is.
HTML was designed to display data and to focus on how data looks.

HTML is about displaying information.
XML is about describing information.

6.Difference between $(this) and ‘this’ in jQuery?
this and $(this) refers to the same element.
when ‘this’ is wrapped in $() ( ex:($(this).text()); ) then it becomes a jQuery object and you are able to use the power of jQuery.

7.Which sign does jQuery use as a shortcut for jQuery?
Ans: $(dollar) sign.

8.What does $(“div”) will select?
Ans: It will select all the div element in the page.

9.What does $(“div.parent”) will select?
Ans: All the div element with parent class.

10.What is the name of jQuery method used for an asynchronous HTTP request?
Ans: jQuery.ajax()

11.What is jQuery Selectors? Give some examples.

jQuery Selectors are used to select one or a group of HTML elements from your web page.
jQuery support all the CSS selectors as well as many additional custom selectors.
jQuery selectors always start with dollar sign and parentheses: $()
There are three building blocks to select the elements in a web document.

1) Select elements by tag name

Example: $(div)
It will select all the div elements in the document.

2) Select elements by ID

Example: $(#select”)
It will select single element that has an ID of select

3) Select elements by class
Example: $(“.helloclass”)
It will select all the elements having class helloclass

12.What is .siblings() method in jQuery?

We filter the elements fetched by an optional selector.

Eg:
<div><span>Hello</span></div>
<p>Hello Again</p>
<p>And Again</p>
<script>$(“p”).siblings(“.selected”).css(“background”, “yellow”);</script>

 

Referred by :

http://api.jquery.com/
http://jquerybyexample.blogspot.com/
http://careerride.com/jQuery-Interview-Questions.aspx#javascript

 

jquery slider inside fancybox

5 Sep

Jquery Auto-Playing Slide-show inside fancy-box

 

/* Fancy box code */

<script type=”text/javascript”>
$(document).ready(function() {
$(“a#fancybox”).fancybox({
‘overlayShow’    : true,
‘autoScale’: true,
‘transitionIn’    : ‘elastic’,
‘transitionOut’    : ‘elastic’
});

});

</script>

/*jquery code for image slide */

<script type=”text/javascript”>
$(“#slideshow > div:gt(0)”).hide();

setInterval(function() {
$(‘#slideshow > div:first’)
.fadeOut(1000)
.next()
.fadeIn(1000)
.end()
.appendTo(‘#slideshow’);
},  3000);
</script>

————————-

/* HTML */

<div> <a id=”fancybox” style=”text-decoration: underline;font-size: 13px”  href=”#slideshow”>Click Here</a></div>


<div id="slideshow">
   <div>
     <img src="image1.jpg">
   </div>
   <div>
     <img src="image2.jpg">
   </div>
   <div>
     Pretty cool eh? This slide is proof the content can be anything.
   </div>
</div>

----------

/* css */


#slideshow {
    width: 600px;
    height: 400px;
   }
#slideshow img {
    margin-top: 20px;
    margin-left: 38px;
    border: 2px solid #ccc;
}

#slideshow > div {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
}
-----------------

/* script */
<script type='text/javascript' src='{% media  "/media/js/googleshare.js" %}'></script>
<script type="text/javascript" src='{% media  "/media/js/fancybox/jquery.fancybox-1.3.4.pack.js" %}'></script>

slider_inside_fancybox

<link rel="stylesheet" href='{% media  "/media/js/fancybox/jquery.fancybox-1.3.4.css" %}' type="text/css" media="screen" />

-------

Referred by :
http://css-tricks.com/snippets/jquery/simple-auto-playing-slideshow/


 

 

CSS CODE : Border-Radius

26 Jul

CSS CODE : Border-Radius

SUPPORT((Firefox,Internet Explorer,Chrome,Safari,Opera,Netscape Navigator)

-moz-border-radius: 2px 2px 2px 2px;
-webkit-border-radius: 2px 2px 2px 2px;
-o-border-radius: 2px 2px 2px 2px;
-ms-border-radius: 2px 2px 2px 2px;
-khtml-border-radius: 2px 2PX 2PX 2PX;
border-radius: 2px 2px 2px 2px;