Categories
Reviews

A New Facet To Re-Use Your Code Snippet With Code Barrel

code barrel-thumbnailA few weeks ago, I had written a post on “Search WprdPress stuff with wpseek” and through a feedback I came to know about a web application Code Barrel which provides user the ability to re-use the code, I examined it and got stuck to it including its classy design and sleek navigation, I was hurried to implement it, eventually I signed up a free account and started implementing it.

Code Barrel was first designed for their own development purpose that data can be stored, shared and re-used. It provides functionality like tagging, advanced search copy paste etc. It can also keep track of snippet revision, supports commenting, email notification is sent when snippet is changed. It will assist developers to boost up their work-flow.

Code Barrel is a global and secure central repository or online storage for storing code snippets for re-usability. Code Barrel is a hosted solution, so no need to download client, install or update. It is a perfect solution for software development companies and workgroups.

It supports most of the programming language. It is specifically designed to store and share code snippets among the team that makes developer speed up with their code. Visual Studio is a free code barrel plug-in that can easily be used. An Eclipse plug-in is under development and will be available soon.

Code Barrel Web

You can take a demo here, no account needed.

  • Click Add button on the top-right of the window.
  • Enter the title, its description then select language and add tag to it.
  • Now you can paste your code or import it from file.
  • And you are done with adding the data.
  • You can see the latest activity in the right hand side window.

Code Barrel UI

  • You can view the existing code when you click on any of the snippet as shown in the image below.
  • You can also view and share comment for the code.

Code Barrel code

Advantages of using Code Barrel

  • Store code snippets for any programming language.
  • Search and tag your snippets.
  • Track snippet revisions.
  • Comment on your or your teammates snippets.

Thank to Mr. Keir Davis for introducing such facet. I expect it will help a lot.

Do drop in your comments.

Categories
Reviews

“When Can I Use” – Online Tool to Check Crossbrowser Support for Web Standards

There are many browsers in the market I get totally confused which browser supports which feature, be it HTML5 or CSS3 or something else. I Googled and I found “When can I use…”

When can I use… page shows tables of a variety of current and upcoming web technologies. For all major browsers (Firefox, Internet Explorer, Opera and Chrome, Safari). we can customize the page that shows only certain browser and features. It is  also included at the bottom of the page, which shows the percentage of the displayed features are supported.

Below there are few screenshot taken from the official web site.

caniuse2

caniuse4

canIuse1

caniuse3

Few feature may not support 100%, so what may be supported today may not actually work in the future. However it is likely that in most cases the browser will update its support as the aspect changes.

The feature list includes anything is of significant use to web designers, but still lacks support in at least one browser version. Indexes and Tables are available to compare different browser along with categories and Status, you can select browser of your choice to compare. As you select the check boxes the comparison appears on the below table.

Do drop in your comments.

Link : When can I use…

Categories
Tutorial

jQuery Codes to Fix Facebook Share’s Zero-Count

It’s been a long time since Facebook started providing the official share-count. Before that, the void was  filled by a third-party service called fbShare.me, which is still active and works fine.

During one of my performance-optimization experiment, I found that the official Facebook share-count loads much faster. Also, being “official”, it seems a safer choice keeping the future in mind.

But when I switched to new codes, a new problem surfaced as you can see in the screenshot below…

The issue is, if Facebook share count is zero, the big share button shrinks to 1/4 of its size and hides the counter because of the surrounding buttons near it. I prefer the share-count to show even if it was zero.

I really thought that Facebook might have some parameters or setting to fix it, but after a lot of brainstorming, I finally managed to fix it using jQuery codes below:

//fix facebook share's zero-count
jQuery(document).ready(function(){
    jQuery(".fb_share_no_count .fb_share_count_inner").text("0");
    jQuery(".fb_share_no_count").removeClass("fb_share_no_count");
});

Of course, for the above code to work smoothly, you must have jQuery included somewhere before the above code-snippet.

Here is how it will look like after the fix…

I hope you will find this code useful! 😉

Categories
Tips

Gradient Generator – Online Tool to Generate CSS Gradient Property

I love to use CSS3 properties which is capable of doing enormous things. Lets take an example say border-radius that helped me reducing unwanted structural markup of my HTML file.

On the other hand lets talk about CSS3 Gradient property. I use to skip some CSS3 property like CSS Gradient because it becomes tedious to write its color codes, instead I like to implement the images. Now it is quite easier to implement CSS Gradient using Ultimate CSS Gradient Generator. It’s a free online tool for web developers that produces CSS3 gradient property in no time. I just have to copy paste it to my stylesheet.

Below is the screen shot of Ultimate CSS Gradient Generator.

Ultimate CSS Gradient Generator

Color-picker will pop up when you click on the color, it’s a bit similar to Photoshop.

color-picker

Features :

  • Free online web application.
  • Simple user interface easy to understand.
  • Produces CSS gradient property in no time.
  • Watch horizontal and vertical gradient preview.

The below code is generated from Gradient-editor.

background: #febbbb; /* old browsers */

background: -moz-linear-gradient(top, #febbbb 0%, #fe9090 29%, #ff5c5c 100%); /* Firefox */

background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#febbbb), color-stop(29%,#fe9090), color-stop(100%,#ff5c5c)); /* webkit */

filter: progid:DXImageTransform.Microsoft.gradient( startColorstr=’#febbbb’, endColorstr=’#ff5c5c’,GradientType=0 ); /* ie */

The Ultimate CSS Gradient Editor was created by Alex Sirota (iosart).

Link : Ultimate CSS Gradient Generator

Categories
Tips

[How to] Display search result count on search page

You can decorate your search result page in WordPress by displaying search count in page title. Most WordPress themes show search results on search.php. We have to add just a few lines of code in our page title.

Code

<h2>
<?php
$rt_search = &new WP_Query(“s=$s&showposts=-1”);
$rt_search_key = esc_html($s, 1);
$count = $rt_search->post_count;
echo ‘Search Result for <span>”‘ . $rt_search_key . ‘”</span>  –   ‘.$count;
if($count > 1 ) echo ‘ Results’; else echo ‘ Result’ ;
wp_reset_query();
?>
</h2>
Just add this code in page title. The result will look something like the image below. 🙂

Do drop in your comments and views.

Categories
Tips

Remove All Unused CSS Selector And Keep Your Stylesheet Clean [Firefox Extension]

It detects all unused CSS selectors from the stylesheet and helps removing unwanted classes from the stylesheet. This Firefox extension “dust me selector” is very useful for keeping your stylesheet clean.

Dust-me-Selector

Once you have finished writing CSS, click on the ‘dust me selector’ icon in the status bar and it will find all the unused selectors. As you can see in the above image it provides the line number which you can use as reference to remove the selectors from your stylesheet. Lesser the code smaller the file size! 🙂

Link: Dust-Me Selector

Go to Parent Post.


Categories
Tips

How to create a WordPress project in NetBeans

NetBeans is such an awesome IDE that I use for all my WordPress projects. This tutorial will help you understand how to create WordPress project using NetBeans IDE.

I have downloaded WordPress version 3.0.1  and unzipped it to a new folder in “C:xampphtdocs” directory. I then created a database with xampp server for this demonstration. Check out details on installing WordPress on your PC.

First download NetBeans from its official website.

Now to configure NetBeans project

First we need to create a new project with existing sources.

Existing source

  • Now browse for the ‘Source Folder’ where we have unzipped WordPress. (eg: C:xampphtdocs)
  • Then fill in your project name.
  • Make sure that the check box is selected which ensures NetBeans meta data goes into separate folder.

Browse source folder

  • Now we can specify if the project will run as a local website or a remote website.
  • Here I have selected  it to run locally. Now click finish button to complete the project.

Run as local host

  • Now the project is created in NetBeans.

Project created

Run “localhost/Demo” on the browser and we can see the website we are working on.

Advantages of using NetBeans for WordPress projects

  • NetBeans IDE is built using an open source API called NetBeans Platform.
  • Extensible and easy modular design.
  • Vast API of commonly used tasks.
  • Pre-defined update center and automatic update notification.

Do write in your views through your comments.

Categories
Reviews

Split Browser Screen for Comparing Mockups [Firefox Extension-Tile Tab]

I always find it difficult to compare mockups with my website, so I came across a Mozilla add-on which splits the browser in tile pattern. I used to compare the mockup with the original website is to toggle ALT + TAB. Then I found a better solution which can be used with Mozilla add-on called Tile Tabs. There are several ways of doing this but I found Tile Tabs the easiest to use.

How to go about it :

  • Install fire fox add-on “Tile Tabs”.
  • Open your .JPG (whatever the extension is .gif .png) file in browser window.
  • Right Click your mouse button to open the image with Firefox.

open-with

  • Now switch to your browser.
  • Go to file menu->Tile.
  • Tile Tab->Below->choose your tab (in which the image file is opened).

tiletab

  • Press F9 (Shortcut key) to toggle screen and F8 to toggle synchronize scroll.
  • Now you can see in the below image how it works.

f9

Do drop in your comments.

Link: Tile Tabs

Go to Parent Post.

Categories
Tips

Clear Parent Element In CSS Using Clearfix

Overflow:hidden is very popular method to clear floats without adding extra markup. I always use overflow:hidden but it becomes undesirable in few circumstances where I place absolute positioned element it cuts off the element. So we can make use of different methods.

I have explained it with two different examples below how we can clear the parent element.

A parent div with child element which has float property affects the parent div or makes it disappear.

General

ADVERTISEMENT
<div class="parent">
<div class="child">child 1</div>
<div class="child">child 2</div>
<div class="child">child 3</div>
<div class="child">child 4</div>
</div>

<!--------------------------------------------->

.parent {   width: 416px;   padding: 20px ;  background-color: tan;   }
.child  {   width: 200px;   height: 100px;   float: left; border: 1px solid #000;   margin:2px;   background-color: green   }
.clear  {   clear:both   }

As you can see in the below image what happens when the child element has float property.

clear1

I have  added an extra div at the end this it will clear the float and solves the issue but in the next example I will show you how to clear it without including extra markup.

Method 1

ADVERTISEMENT
<div class="parent">
<div class="child">child 1</div>
<div class="child">child 2</div>
<div class="child">child 3</div>
<div class="child">child 4</div>

<div class=”clear”></div>
</div>

After clearing the float it results in something like this.

clera2

Now I am adding a class to a parent element which forces its children to self clear, in this technique we do not have to create extra markup. Both technique results in same but I found using clearfix better as it is also implemented in HTML5 Boilerplate.

Method 2

<div class="parent clearfix">
<div class="child">child 1 </div>
<div class="child">child 2 </div>
<div class="child">child 3 </div>
<div class="chlid">child 4 </div>
</div>
<!-------------------------------------------->

.clearfix:before,
.clearfix:after {
content: ".";
display: block;
height: 0;
overflow: hidden;
}
.clearfix:after {clear: both;}
.clearfix {zoom: 1;} /* IE < 8 */

That concludes two methods to clear parent element,  one uses extra markup and the other method saves the extra structural markup. Thanks to Thierry Koblentz for Clearfix Realoded.


Categories
Reviews

Search WordPress stuff with wpseek

When I started using WordPress I always used to search for tools that help in coding, save search time, provide rich features and all content should be available at the same place.

wpseek is an excellent web application that helps in searching WordPress stuff. It’s a centric searching tool. This helps developer find all the WordPress Functions, Hooks, Function Sources,  Actions, Template Tags and a lot more just at one place.

wpseek_search

Features of wpseek

  • While searching for functions with wpseek, you get auto-suggestions making it very easy to look up those functions.
  • The search results show up top Google search links for that keyword along with links to related codex documentation.

wpseek_info

  • You can look up the general information for the function along with code snippets.
  • You can add wpseek as a search engine in your browser.

add-search

If you are a WordPress developer or theme author then you will find wpseek useful. If you know any other such web application do share it with me through the comments.

Link: wpseek