addthis – remove hashtag from url without javascript configuration

- - News, Twitter

When we share any article to social sites like (google, facebook). Addthis adds the hash tag to URL. But sometimes we do not want to track some articles only. Addthis config configuration will apply to all the buttons which are using in site. If you want to remove hashtag from URL for specific buttons you can do that. I will explain that to you. Many people are pisted of this issue. Finally I got the solution. I am able to remove hashtag from url without javascript configuration.

Using following code we can remove the hashtag from URL:

var addthis_config = addthis_config||{};
addthis_config.data_track_addressbar = false;
addthis_config.data_track_clickback = false;

If you want to set setting or configurationthe each rendering buttons. You can easily control the addthis button configuration for each buttons.

You can use following HTML in your webpage.

<!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style addthis_16x16_style">
<a class="addthis_button_google_plusone_share" addthis:data_track_clickback="false" addthis:data_track_addressbar="false" addthis:url="http://digcms.com" addthis:title="Digging in to depth" addthis:description="Digging in to depth....."></a>
<a class="addthis_button_facebook" addthis:data_track_clickback="false" addthis:data_track_addressbar="false" addthis:url="http://digcms.com" addthis:title="Digging in to depth" addthis:description="Digging in to depth....."></a>
<a class="addthis_button_twitter" addthis:data_track_clickback="false" addthis:data_track_addressbar="false" addthis:url="http://digcms.com" addthis:title="Digging in to depth" addthis:description="Digging in to depth....."></a>
<a class="addthis_button_pinterest_share" addthis:data_track_clickback="false" addthis:data_track_addressbar="false" addthis:url="http://digcms.com" addthis:title="Digging in to depth"></a>
<a class="addthis_button_linkedin" addthis:data_track_clickback="false" addthis:data_track_addressbar="false" addthis:url="http://digcms.com" addthis:title="Digging in to depth" addthis:description="Digging in to depth....."></a>
</div>
<!-- AddThis Button END -->

What I did?
I just added the following HTML element atttributes to each buttons. That will remove hashtag from URL while you are sharing the content to sites.

addthis:data_track_clickback=”false” addthis:data_track_addressbar=”false”

Redirect to custom page after wordpress user registration

- - Wordpress

In many wordpress sites we are using the user registration. Many times client want the custom landing page after user registration. There are many wordpress plugins which gives you the redirection facility after login or registration. WordPress User registration is very important functionality.

Using following code you can redirect the user to custom page. You just need to copy and put following code into functions.php file.

function redirect_to_custom_page(){
return home_url( '/custom-page' );
}
add_filter( 'registration_redirect', 'redirect_to_custom_page' );

Thanks WPAPI.COM for the wordpress Hack!

Solved : Channel pear is already initialized

- - PHP

I faced channel pear installation issue many times on many linux OS. I installed the pear package first then I removed pear package from linux box. Then when I again tried to install the pear package on box I got the following error. I solved the channel pear issue using following commands.

[root@localhost purab]# pear channel-discover pear.cakephp.org
Channel “pear.cakephp.org” is already initialized
[root@localhost purab]# pear install cakephp/CakePHP
No releases available for package “pear.cakephp.org/CakePHP”
install failed

[root@localhost purab]# pear remote-list -c cakephp
File http://pear.cakephp.org:80/rest/c/categories.xml not valid (redirected but no location)

[root@localhost purab]# pear install cakephp/CakePHP
No releases available for package “pear.cakephp.org/CakePHP”
install failed

[root@localhost purab]# pear channel-discover pear.cakephp.org
Channel “pear.cakephp.org” is already initialized
[root@localhost purab]# pear upgrade pear
Nothing to upgrade

Following command is solved my issue and I am able to install pear package successfully.
[root@localhost purab]# pear clear-cache
reading directory /var/cache/php-pear
302 cache entries cleared

[root@localhost purab]# pear install cakephp/CakePHP
Unknown remote channel: pear.phpunit.de
Did not download optional dependencies: channel://pear.phpunit.de/PHPUnit, use –alldeps to download automatically
cakephp/CakePHP can optionally use package “channel://pear.phpunit.de/PHPUnit” (version >= 3.5.0)
downloading CakePHP-2.4.2.tgz …
Starting to download CakePHP-2.4.2.tgz (1,377,541 bytes)
……………done: 1,377,541 bytes
install ok: channel://pear.cakephp.org/CakePHP-2.4.2
[root@localhost purab]#

Use following command command for solve the issue.
#pear clear-cache

Cakephp installation and blog tutorial step by step

- - PHP

CakePHP is one of the best PHP MVC framework which is purely inspired by Ruby on Rails. I worked on ROR for many years. So I know CakePHP has very similar ROR standards. Here In this article I will show you about CakePHP installation on linux box in very detailed information. I created the very basic blog application using CakePHP and It is free for download.

I am using the linux box for installation following commands will be useful for any linux installation. You can use the any linux OS like (Ubuntu, Fedora, Redhat, centos, etc… )

#pear channel-discover pear.cakephp.org
#pear remote-list -c cakephp
#pear install cakephp/CakePHP

Go to folder where you want to create the project
#cd /var/www/html/

Create the project using following command
#cake bake project cakeblog

{
"name": "cakeblog",
"repositories": [
{
"type": "pear",
"url": "http://pear.cakephp.org"
}
],
"require": {
"pear-cakephp/cakephp": ">=2.4.0"
},
"config": {
"vendor-dir": "Vendor/"
}
}

#cd cakeblog
#chown purab:purab -R cakeblog
#chown apache:apache -R cakeblog/tmp

Download debug_kit

https://github.com/cakephp/debug_kit

Add into the Plugin Dir

Download commposer

http://getcomposer.org/download/

using following command and console:
#curl -sS https://getcomposer.org/installer | php

Create the composer.json file in cakeblog folder and add following lines in that file

After that execute the following command

#php composer.phar install

Open the webroot/index.php file and add the following lines at line no 82.

define(
'CAKE_CORE_INCLUDE_PATH',
ROOT . DS . APP_DIR . '/Vendor/pear-pear.cakephp.org/CakePHP'
);

You can download my Blog code from here.

https://github.com/purab/cakeblog

Reference Used:

http://book.cakephp.org/2.0/en/getting-started.html#blog-tutorial

http://book.cakephp.org/2.0/en/installation/advanced-installation.html

how to make drupal seo friendly with drush commands

- - Drupal, Seo

Drupal became more powerful and popular now. I will show you with in just 5 minute you can create the drupal site ful SEO friendly. You just need to use the some drush commands for this. That commands will take care of all the things.

Following drush commands will install all the required drupal modules and enable it drupal application.

Following command will install SEO related modules in drupal.
#drush pm-enable seotools -y

Following command will install the site verify module.
#drush pm-enable site_verify -y

Following command will install the google analytics module.
#drush pm-enable google_analytics -y
#drush pm-enable recaptcha -y

Drupal became more powerful and popular now. I will show you with in just 5 minute you can create the drupal site ful SEO friendly. You just need to use the some drush commands for this. That commands will take care of all the things.

Following drush commands will install all the required drupal modules and enable it drupal application.

Following command will install SEO related modules in drupal.
#drush pm-enable seotools -y
#drush pm-enable site_verify -y
#drush pm-enable google_analytics -y
#drush pm-enable recaptcha -y
#drush pm-enable tagclouds -y
#drush pm-enable gss -y
#drush pm-enable mostpopular -y
#drush pm-enable easy_social -y

#drush pm-enable tagclouds -y
#drush pm-enable gss -y
#drush pm-enable mostpopular -y
#drush pm-enable easy_social -y

I recommend you need to install all above modules in every drupal application.

wordpress to drupal migration using drush commands made easy

- - Drupal

I migrated some wordpress sites into drupal very easily.  With drupal 7 it is very easy. There are some drupal modules which are really helpful to migrate the wordpress posts and pages in drupal site. Drupal is more famous and usable in people and developers. Many clients demands for doing there site in drupal. With my simple steps you can easily migrate the wordpress sites to drupal.

If you are drupal developer then you just need to use following drush commands with plain drupal installation. Many people are moving there sites to drupal now.

Following commands will install all related drupal modules which are helpful to do the wordpress to drupal migration.

#drush pm-enable migrate_extras -y
#drush pm-enable wordpress_migrate -y
#drush pm-enable pathauto -y
#drush pm-disable ckeditor -y
#drush pm-enable media -y
#drush pm-enable token -y
#drush pm-enable imce -y

Above commands will download the module and install it in your drupal application. Modules will be activated also. Now you just need to import your wordpress blog into drupal application.

Login to drupal admin and go to “admin/content/wordpress”.  Add the wordpress URL, username and password. Then click on “Import wordpress blog” button. That sit.

 

how to disable drupal theme using drush command

- - Drupal

Every drupal developer knows about drush and drush commands. If mistakenly you installed some broken drupal theme and you are not able to access site then you need change the drupal theme using drush command.

#drush vset theme_default seven

Using above command you can set the seven theme as default drupal theme. It will disable the your activated old theme.

Note: this command I given for drupal7

Front developer interview questions and answers by digcms

- - PHP, Seo, Web Design

Taking interview and preparing for taking the interview is always a task. It takes time for prepair the questions. In every project forntend developers are required. You can use any language for devlopment but still you required the frontend developer for that. Here I collected some nice interview questions for frontend developer interview.

CSS

Did you worked on responsive design?
Have you worked with javascript libraries? – follow-up: which, and why that one over others?
Are you following the development of HTML5 and CSS3? – follow-up: Which features are you looking forward to the most, and why?
How to explain DOM.
Why and when should you use div ? (ie, not every time, only when insufficient markup or need to wrap several elements)
When using IDs, when using classes ?
Do you use some naming convention for your ids and classes.
Describe what a “reset” CSS file does and how it’s useful.
Describe Floats and how they work.
What are the various clearing techniques and which is appropriate for what context?
Explain CSS sprites, and how you would implement them on a page or site.
What are your favourite image replacement techniques and which do you use when?
CSS property hacks, conditionally included .css files, or… something else?
How do you serve your pages for feature-constrained browsers?
What techniques/processes do you use?
What are the different ways to visually hide content (and make it available only for screen readers)?
Have you ever used a grid system, and if so, what do you prefer?
Have you used or implemented media queries or mobile specific layouts/CSS?
Any familiarity with styling SVG?

HTML5

What would you change about HTML5/CSS3 if you could?
What is your favorite feature in HTML5 and how would you use it?
What’s a doctype do, and how many can you name?
What’s the difference between standards mode and quirks mode?
What are the limitations when serving XHTML pages?
Are there any problems with serving pages as application/xhtml+xml?
How do you serve a page with content in multiple languages?
What kind of things must you be wary of when design or developing for multilingual sites?
Can you use XHTML syntax in HTML5?
How do you use XML in HTML5?
What are data- attributes good for?
What are the content models in HTML4 and are they different in HTML5?
Consider HTML5 as an open web platform. What are the building blocks of HTML5?
Describe the difference between cookies, sessionStorage and localStorage.

Javascript
Explain the difference between the JavaScript call and apply functions.
Have you worked with javascript libraries? If yes then which one?
What is the difference between event bubbling and event capture?
Explain the difference between the JavaScript call and apply functions.
Puzzle: Emulate the game “Secret Santa” where there are 3 or more participants, no participant can receive their own gift or receive more than one gift. Do this in JavaScript.
Identify two ways in which you can clear a floated element with HTML/CSS.
What is the difference between event bubbling and event capture?
Describe a rendering problem you had in IE6 or IE7, and how you overcame it.
Define the term ‘closure’ and give an example of it in JavaScript.
Explain the differences between the IE and DOM standard event model.
What is the proper way to evaluate JSON from the server, and why is this the proper way?
What are undefined and undeclared variables?
What is a closure, and how/why would you use one?
Your favorite pattern used to create them? argyle (Only applicable to IIFEs)
What’s a typical use case for anonymous functions?
Explain the “JavaScript module pattern” and when you’d use it.
Bonus points for mentioning clean namespacing.
What if your modules are namespace-less?
How do you organize your code? (module pattern, classical inheritance?)
What’s the difference between host objects and native objects?
Difference between: javascript function Person(){} var person = Person() var person = new Person()
What’s the difference between .call and .apply?
explain Function.prototype.bind?
When do you optimize your code?
Can you explain how inheritance works in JavaScript?
how do u detect useragent in css . suppose u want to use different css on mobile devices

JQuery

Describe for me how to write an extension for JQuery.
How to solve the jquery conflict?
How to detect the Browser name using Jquery?
Describe for me how to write an extension for JQuery.
Describe the architecture of JQuery and compare it to YUI
How, and why, would you namespace a bound event handler?
Name 4 different values you can pass to the jQuery method.
Selector (string), HTML (string), Callback (function), HTMLElement, object, array, element array, jQuery Object etc.
What is the effects (or fx) queue?
What is the difference between .get(), [], and .eq()?
What is the difference between .bind(), .live(), and .delegate()?
What is the difference between $ and $.fn? Or just what is $.fn.
Optimize this selector: javascript $(“.foo div#bar:eq(0)”)
Difference between ‘delegate()’ and ‘live()’?

CMS

Did you worked on theming? If yes then for which CMS?
Did you worked on wordpress, Drupal, Moodle

Common

What inspires you to create good looking and functional websites?
What do you think are the strengths of digital marketing via web and social media?
Which areas of web development are you interested in? please range from most interested to least interested. (design, code (HTML, CSS), interactivity (Flash, silverlight, jQuery), usability, SEO etc).
Why is it important to write good semantic code, and separate information(HTML) from layout(CSS) and behaviour (javascript)
What is a good website for you? feel free to show examples