To open a link in new tab, using Jquery, use window.open and pass the url
1 2 3 |
('.redirect').click(function() { window.open('http://devendraverma.com/useful-git-resources/'); }); |
To open a link in new tab, using Jquery, use window.open and pass the url
1 2 3 |
('.redirect').click(function() { window.open('http://devendraverma.com/useful-git-resources/'); }); |
To download file through ftp / http which are password protected, use following command
1 |
$ wget --user=deven --password='123456' http://dropbox.com/mydoc.html |
This is my list of useful date formats in PHP for my own reference, I update it whenever I come across to new ones, so that I don’t need to search for it on web.
To get the Day of a date
1 2 |
$date = "2013-04-22"; echo "Today is ".Date('l', strtotime($date)); |
To get a date in this format
22 April 2013
1 2 |
$date = "2013-04-22"; echo "Today is ".Date('d F Y', strtotime($date)); |
To get, Jul 18
1 2 |
$date = "2013-04-22"; echo "Today is ".Date('M d', strtotime($date)); |
Adding no of days to a PHP date, In this example we are adding 2 days to a PHP date
1 2 |
$date = "2013-04-22"; echo date('Y-m-d', strtotime($date. ' + 2 days')); |
Using following code we can change the action attribute of the form and submit it
1 2 |
$("form").attr("action", "/ControllerName/Method"); $("form").submit(); |
List of useful git resources, that I have come across.
37 single’s
https://37s.backpackit.com/pub/1465067
Git refcard on DZone
http://refcardz.dzone.com/refcardz/getting-started-git?uid=835453&nid=21049&token=08354531112134474811f
Git – the simple guide
http://rogerdudler.github.com/git-guide/
Git reference
Getting started about version control
http://git-scm.com/book/en/Getting-Started-About-Version-Control
Git in 15 minutes
Add other useful resources known to you in the comment below ๐
To install FriendsApp on Ubuntu 12.10, follow these commands
1 2 3 4 5 |
sudo add-apt-repository ppa:canonical-qt5-edgers/qt5-proper sudo add-apt-repository ppa:ubuntu-sdk-team/ppa sudo add-apt-repository ppa:super-friends/ppa sudo apt-get update sudo apt-get install friends-app unity-lens-friends |
It is much easier to install on Ubuntu 13.04, just use this one line command
1 |
sudo apt-get install friends-app |
It is very easy to install Git on Ubuntu, just use following command to install it,
1 |
sudo apt-get install git |
After download, you are ready to use Git !
To get the title of current page, there is a one line of JQuery code
1 |
$(document).attr('title'); |
To read the meta description of current, use following code
1 |
$('meta[name="description"]').attr('content'); |
To get the url of current page
1 |
$(location).attr('href'); |