Javascript Copy to Clipboard

Hi Guys, I thought I should share this with you. Well in this post I am just going to show you how we can do it. Now with each browser there could be their own clipboard handlers but some of them may not have the ability to access clipboard so we will make use of ZeroClipboard which is javacsript based but uses Flash transparently to make use of Clipboard. Zeroclipboard can be found here http://code.google.com/p/zeroclipboard/ I will also cover lightweight jQuery Plugin that utilizes ZeroClipboard too. Library is call zClip. But first lets go the traditional way Lets check how HTML will look like if you wish to use ZeroClipboard. And this is hwo you should use the javascript   That's it. You're done. You copy to clipboard function is now ready. You can download this awesome library from here http://code.google.com/p/zeroclipboard/downloads/list   Second method is to use jQuery if you don't want to do the above. So equivalent to above method in jquery will be zClip can be downloaded from this website http://www.steamdev.com/zclip/   Its really simple and straight forward. you can read some more examples there. My intention was to show you couple of options. There are other libraries around but I found ZeroClipboard to be more complete just because of its event handling. I hope this helps Cheers, Advertisement   … [Read more...]

Google Drive this is not your original Google Drive Folder

Hi Guys, Let me have this opportunity to assist you with this error when you are trying to relocate your folder. Ok you get this error because you are not selecting the right folder that was expected by Google drive. So consider the following screen shot of my relocated Google Drive.   Now if I try to select GDrive when I try to relocate my Drive folder as a result of action from below screenshot. then I will get the above error.   But If I select Google Drive folder then the action is successful. This is because that Google Drive folder is created and recognized by GDrive sync er. If you feed some other folder other that what's recognized you are bound to get this error "this is not your original Google Drive Folder" Try to keep your GDrive on same disk partition. Try to move it to different partition and see what happens? A home exercise.  :) I hope this helps Cheers, Advertisement   … [Read more...]

WordPress: What if I accidently deleted my old post and have no backup

Hi Guys, This happens sometimes when you are thinking about your girl friend or boyfriend :) Ok I understand that you don't have the database backup and you somehow wants to restore your post. I assume at least you remember title of your post. Right? If not then there is no use reading this article further. Ok so you do remember post title, lets continue then. We will be using our well wisher Google to assist locating your content. First go to google.com Now type this in the search box (replace domain name with your and article title with your post title) as shown below   Ok from here on hover on top of you post your will see a shaded double arrow pointing to the right i.e. >> Do not click that just hover as shown below   When you hover you will see a page that you've deleted. Wow! This is because Google caches your data for some day. That's so cool. Now click on the cached link that appears besides the link on hovered pane as shown below   Yippi when you click on the link that's it you get whatever Google have cached for you. Something is better than nothing. There could be other ways including browsing your browser cache but I found this method to be really helpful. Google cache is not updated everyday by the look of things so you are guaranteed to recover some of your lost content. The content that you've changed in last few days may not be recovered using this method. This method will not work if your post of webpage has not been crawled by Google. I Hope this helps Cheers   Advertisement     … [Read more...]

Linux How to Create and extract tar.gz and tar.bz2 archives

Hi Guys, I guess this is a quick tip. Question is How we can create a tar.gz and tar.bz2 in Linux. I use these commands so often that I thought I should share because it could be helpful information. I am not exactly a Linux Pro but more of an intermediate user so your input will be always welcomed. Ok first I started using zip command in Linux a while back and loved it. It was quick and easy and was supported on many OS's like Linux and windows or even Mac. Compression with zip isn't always great then comes tar Now if you just use tar to compress a file that doesn't mean that you are compressing that file or group of files. Its more like packaging a file or group of files and folders. So basic usage of tar is shown below and to extract the above package you use this -c above means create -x means extract The size is pretty much the same when you tar your files because it is just creating a archive for you files. Now lets jump into file compression using tar tar has to be told what algorithm need to be used to  compress your files and directories. So to lets use GZip If you take a look at man page http://unixhelp.ed.ac.uk/CGI/man-cgi?tar You will notice that flag -z can be used to create a GZipped file which Lets change the above tar command that creates of package to the once below to create a Compressed Archive Notice that we added -z and .gz in the file extension. I added .gz so that I am clear when extracting an archive what algo I will need to use to extract the above So lets extract it Advertisement   See that because now I am aware that its gzipped from the extension thus I added -z to my flags else it will fail to extract if different algo is used to try to extract this archive. For me I use it a bit to often and for me it offers good compression. Now we can use BZip to create of archive too as shown below From the manual we saw that -j flag can be used to create … [Read more...]

WordPress Add Custom Media buttons over Post Editor Toolbar

Hi Guys, I am really so pleased to write this one. I am sure that this article will be modified so many times in future based on your feedback and suggestions. There are many ways to do certain things in wordpress and below is what I've got for you. But first check what the final result will look like. Advertisement   Now I have to hack into the wordpress code to see how they do it because I couldn't find some documentation on their website about this. Ok this this was my approach. We know that in the above image we have string called "Upload/Insert" If you search for that string in the Wordpress Files you will notice that that string exist in file /path/to/wordpress/root/wp-admin/includes/media.php Line 376 I am gonna use that concept and try to manipulate to get to the above result. Lets add an action first for our media button Media buttons context is associated with media buttons Now lets add a handler function called jcorgbuttons Now as you can see that we are accepting media button context and lets do something with it. What I am gonna do here is to append our button to that context as shown below This tell WP that while you are doing Media Buttons Please accept mine too. Just by doing the above you will see what I have shown in the Image above. Now by itself it does not mean anything so lets open an external page or your plugin settings page. You can choose any page you like. I will now add an action below to create an admin menu page Now that everything is set we'll go back to our jcorgbuttons($context) function and change it to this Now we are launching a thickbox and we are specifying TB_iframe (means is Thickbox an iFrame) to true. Now with this change when you click on the button or icon that we created a moments ago the result will be like this   Now this is not a restricted option and you can do whatever you like with this option. You can … [Read more...]

Blogging and Social Media

Hi Guys, This is my fifth post in my Blogging Tips series that I started few days back. If you haven't already you can read my previous 2 posts from here Blogging Tips: Where to start Blogging Tips: Think out of the Box Blogging Tips: Why Blogs won't work How to draw traffic to your blog site Today I am going to talk about the importance of social media in the age we are living in and how important it is for your websites. We all know likes of Facebook and twitter. I've just started to use my personal account on Facebook and Twitter to highlight some important stuff that I do for my websites and the response is incredible. With Twitter I don't have many followers but I think it will get better where in other social sites like facebook, I am getting pretty good response from my friends etc. Put it this way. You release a post and talk about it on your Facebook page. If you have 2000 accounts who are your subscribers and you get 500 to check your link out you get instant traffic increase. Now it does not end here. As you saw on my blog that I have social buttons installed so that if a visitor likes the content they are more likely to give it a Facebook thumbs up or a Google +1 or Digg it. When someone likes a link on your website it get certain audience from the person's friend list who liked it. So your article visibility is instantly amplified.  In the end its all about publishing valuable content and getting people to visit your site. If you are doing good work and no one sees what you are doing I guess that's not a good Idea. Let's highlight some key points what I do for in Social amplification of my article or post. Posting your Links Select a group that is relevant to your niche and post your article link there. You are nearly guaranteed to get audience from that group. If you keep posting something valuable every time, you will get a loyal audience. You should try to interact with the group, just posting links will isolate you. … [Read more...]

Linux Count number of Files in Directory

Hi Guys, I thought this may help you in some way. I am only a intermediate user of Linux but like to share stuff that I think could be useful to others. One of those things is How to count number of files in a given directory Well in simplest form browse to your directory and type this What this does is that its piping the output of list command to word count command. so if ls  return N number of lines then wc -l will be N. Second way to do it is just executing ls -l command as shown below Notice the total value that the number of lines there. Now in the above command symbolic links are counted as files and also subdirectories get returned. You can have subdiretories excluded as shown with another Linux command called find -type f means read files only. So no symlinks are returned.   I hope that you found this post useful Cheers,   Advertisement     … [Read more...]

How to publish a plugin to WordPress Successfully – Step by Step Guide using Tortoise SVN

Hi Guys, I would like to take this opportunity to put this topic on table. Now that I have released my first plugin on Wordpress platform. I can share my experiences with you. I assume that you've got your plugin properly tested and there are no known issues with it. But just so that I am comfortable taking you to the next step please ask your questions below Do you have an account with wordpress? If your answer to above question is NO then create one from here  http://wordpress.org/support/register.php Do you have Tortoise Subversion? If your answer is NO. Then download the tool from here. http://tortoisesvn.net/downloads.html Do you have "Powered by" by link in your plugin and your plugin does not offer user an option to take it off? Very Bad. Make sure that you give your plugin user an option so that they can turn it On if they wish. Default value of your setting should be Off. In technical or HTML talk your checkbox should be Unchecked. Do you have Readme.txt file in your  plugin directory root? Create one. Follow the instructions from here http://wordpress.org/extend/plugins/about/readme.txt Ok so now that we have made through the basic checklist. Next thing we would like to do is to create a Plugin Submission request Click on the URL below and create one for your plugin. In a good time a wordpress enthusiast will get back to you normally within few hours after your plugin request submission. Ok so here is the URL http://wordpress.org/extend/plugins/add/ In the plugin URL field you can either point to a webpage where an admin can download your plugin from or you can put a link directly to your ZIP file. I will recommend the latter. Now that you've create the request, wait till you get an approval from Wordpress. When you get an Approval you will get an email something similar to one shown below Your plugin hosting request has been approved. Within one hour, you will have access to your SVN repository … [Read more...]

Free CSS3 pricing page template download

Hi Guys, Got an inspiration from many designs so thought I should contribute as well. Below is what you will be expecting     Below is the Mark-up required to produce above result.   CSS is given below   Download full File from link below   Advantage of above are that you can repeat your pricing section any number of times on a given page because styles are not bound to Container IDs. I hope that you will enjoy it. Making changes to above code is really simple and taking it to another level is what you can do. You can change the code above, host it on your site, don't forget to put a link bck though :) I would like to thanks all websites that have given me direction and inspiration to give you the above. Cheers,   Advertisement     … [Read more...]

mySQL Export select to CSV File Example

Hi Guys, Just a quick tip here I thought you could be interested in knowing something like this. If you are using likes of SQLYog then you use its feature called Export to CSV. You can do pretty much same thing with native select command too lets see how you do it Consider the following table structure Table Name: States Field Type state_id int(5) unsigned NOT NULL state_code varchar(5) NOT NULL state_name varchar(50) NOT NULL country_id int(2) NOT NULL Now a simple select will be like Above will print resultset on mysql console. Now lets guide the resultset to a CSV file Change above command to look like tihs The CSV file will look like this for my above command. (first 6 rows)   Your select can have any number of custom fields. It doesn't matter at all. That's it now the result will be copied to your CSV file. Its pretty straight forward what's shown above. We are instructing mySQL to product a CSV equivalent of the Selected result. To know more about OUTFILE please look into this documentation page http://dev.mysql.com/doc/refman/5.0/en/select-into.html   I hope this helps Cheers, Advertisement     … [Read more...]